Replace hard coded forExport string by mxc url

This commit is contained in:
Jaiwanth 2021-06-29 11:29:05 +05:30
parent e404fa3cae
commit 6cbbc0ecb4
5 changed files with 8 additions and 5 deletions

View file

@ -263,7 +263,9 @@ export default class HTMLExporter extends Exporter {
</MatrixClientContext.Provider>
</div>
let eventTileMarkup = renderToStaticMarkup(eventTile);
if (filePath) eventTileMarkup = eventTileMarkup.replace(/(src=|href=)"forExport"/g, `$1"${filePath}"`);
if (filePath) {
eventTileMarkup = eventTileMarkup.split(mxEv.getContent().url).join(filePath);
}
if (hasAvatar) {
eventTileMarkup = eventTileMarkup.replace(
encodeURI(this.getAvatarURL(mxEv)).replace(/&/g, '&amp;'),