From f6cf3b378be35e1e1ad38ff30a860ab751fb26a6 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 7 Dec 2021 11:33:09 +0530 Subject: [PATCH] Strip reply fallback --- src/domain/session/room/timeline/deserialize.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/domain/session/room/timeline/deserialize.js b/src/domain/session/room/timeline/deserialize.js index 7da6255d..b66804a5 100644 --- a/src/domain/session/room/timeline/deserialize.js +++ b/src/domain/session/room/timeline/deserialize.js @@ -346,6 +346,10 @@ class Deserializer { } 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>/, ""); + } const parseResult = platform.parseHTML(html); const deserializer = new Deserializer(parseResult, mediaRepository, allowReplies); const parts = deserializer.parseAnyNodes(parseResult.rootNodes);