Strip reply fallback

This commit is contained in:
RMidhunSuresh 2021-12-07 11:33:09 +05:30
parent 35a13842af
commit f6cf3b378b

View file

@ -346,6 +346,10 @@ class Deserializer {
} }
export function parseHTMLBody(platform, mediaRepository, allowReplies, html) { export function parseHTMLBody(platform, mediaRepository, allowReplies, html) {
if (allowReplies) {
// todo: might be better to remove mx-reply and children after parsing, need to think
html = html.replace(/<mx-reply>.+<\/mx-reply>/, "");
}
const parseResult = platform.parseHTML(html); const parseResult = platform.parseHTML(html);
const deserializer = new Deserializer(parseResult, mediaRepository, allowReplies); const deserializer = new Deserializer(parseResult, mediaRepository, allowReplies);
const parts = deserializer.parseAnyNodes(parseResult.rootNodes); const parts = deserializer.parseAnyNodes(parseResult.rootNodes);