forked from mystiq/hydrogen-web
Use DOMPurify to remove mx-reply
This commit is contained in:
parent
cfefe6962a
commit
27a9f5dd02
2 changed files with 2 additions and 2 deletions
|
@ -345,7 +345,6 @@ class Deserializer {
|
|||
}
|
||||
|
||||
export function parseHTMLBody(platform, mediaRepository, html) {
|
||||
html = html.replace(/<mx-reply>.+<\/mx-reply>/s, "");
|
||||
const parseResult = platform.parseHTML(html);
|
||||
const deserializer = new Deserializer(parseResult, mediaRepository);
|
||||
const parts = deserializer.parseAnyNodes(parseResult.rootNodes);
|
||||
|
|
|
@ -56,7 +56,8 @@ class HTMLParseResult {
|
|||
|
||||
const sanitizeConfig = {
|
||||
ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx|mxc):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i,
|
||||
ADD_TAGS: ['mx-reply']
|
||||
FORBID_TAGS: ['mx-reply'],
|
||||
KEEP_CONTENT: false,
|
||||
}
|
||||
|
||||
export function parseHTML(html) {
|
||||
|
|
Loading…
Reference in a new issue