From 21ae29c002afb6fe1d3b93345ea4e6d00e1198df Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 13 Jun 2024 14:44:48 +0100 Subject: [PATCH] Support s tags for strikethrough for Matrix v1.10 (#12604) * Support s tags for strikethrough for Matrix v1.10 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update src/Linkify.tsx --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/HtmlUtils.tsx | 1 + src/Linkify.tsx | 2 ++ src/Markdown.ts | 2 +- src/editor/deserialize.ts | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index b63ed1dcf0..655be4ac92 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -124,6 +124,7 @@ const topicSanitizeHtmlParams: IExtendedSanitizeOptions = { allowedTags: [ "font", // custom to matrix for IRC-style font coloring "del", // for markdown + "s", "a", "sup", "sub", diff --git a/src/Linkify.tsx b/src/Linkify.tsx index 24a8a153c5..910acc9dde 100644 --- a/src/Linkify.tsx +++ b/src/Linkify.tsx @@ -147,8 +147,10 @@ export const transformTags: NonNullable"), ...parseChildren(n, pc, opts), pc.plain("")]; + case "S": + return [pc.plain(""), ...parseChildren(n, pc, opts), pc.plain("")]; case "SUB": return [pc.plain(""), ...parseChildren(n, pc, opts), pc.plain("")]; case "SUP":