From f7ac03ee94d9d32e26bd712e8dc05a6109f5e835 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 28 Feb 2022 15:13:56 +0100 Subject: Fix client html performance regression --- server/helpers/markdown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/markdown.ts b/server/helpers/markdown.ts index 25685ec6d..41c1186ec 100644 --- a/server/helpers/markdown.ts +++ b/server/helpers/markdown.ts @@ -8,7 +8,7 @@ const markdownItEmoji = require('markdown-it-emoji/light') const MarkdownItClass = require('markdown-it') const markdownItWithHTML = new MarkdownItClass('default', { linkify: true, breaks: true, html: true }) -const markdownItWithoutHTML = new MarkdownItClass('default', { linkify: true, breaks: true, html: false }) +const markdownItWithoutHTML = new MarkdownItClass('default', { linkify: false, breaks: true, html: false }) const toSafeHtml = (text: string) => { if (!text) return '' @@ -66,7 +66,7 @@ function plainTextPlugin (markdownIt: any) { if (token.type === 'list_item_close') { lastSeparator = ', ' - } else if (/[a-zA-Z]+_close/.test(token.type)) { + } else if (token.type.endsWith('_close')) { lastSeparator = ' ' } else if (token.content) { text += lastSeparator -- cgit v1.2.3