Allow matrix scheme

This commit is contained in:
Danila Fedorin 2021-08-27 16:36:14 -07:00
parent eef5cbbace
commit dbce6285d9
2 changed files with 2 additions and 2 deletions

View file

@ -29,7 +29,7 @@ import { linkify } from "./linkify/linkify.js";
*/ */
const basicInline = ["EM", "STRONG", "CODE", "DEL", "SPAN" ]; const basicInline = ["EM", "STRONG", "CODE", "DEL", "SPAN" ];
const basicBlock = ["DIV", "BLOCKQUOTE"]; const basicBlock = ["DIV", "BLOCKQUOTE"];
const safeSchemas = ["https", "http", "ftp", "mailto", "magnet"].map(name => `${name}://`); const safeSchemas = ["matrix", "https", "http", "ftp", "mailto", "magnet"].map(name => `${name}:`);
const baseUrl = 'https://matrix.to'; const baseUrl = 'https://matrix.to';
const linkPrefix = `${baseUrl}/#/`; const linkPrefix = `${baseUrl}/#/`;

View file

@ -55,7 +55,7 @@ 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|matrix):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i,
ADD_TAGS: ['mx-reply'] ADD_TAGS: ['mx-reply']
} }