mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Use DOMPurify to remove mx-reply
This commit is contained in:
parent
cfefe6962a
commit
27a9f5dd02
@ -345,7 +345,6 @@ class Deserializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function parseHTMLBody(platform, mediaRepository, html) {
|
export function parseHTMLBody(platform, mediaRepository, html) {
|
||||||
html = html.replace(/<mx-reply>.+<\/mx-reply>/s, "");
|
|
||||||
const parseResult = platform.parseHTML(html);
|
const parseResult = platform.parseHTML(html);
|
||||||
const deserializer = new Deserializer(parseResult, mediaRepository);
|
const deserializer = new Deserializer(parseResult, mediaRepository);
|
||||||
const parts = deserializer.parseAnyNodes(parseResult.rootNodes);
|
const parts = deserializer.parseAnyNodes(parseResult.rootNodes);
|
||||||
|
@ -56,7 +56,8 @@ class HTMLParseResult {
|
|||||||
|
|
||||||
const sanitizeConfig = {
|
const sanitizeConfig = {
|
||||||
ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx|mxc):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i,
|
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) {
|
export function parseHTML(html) {
|
||||||
|
Loading…
Reference in New Issue
Block a user