aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/markdown.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-28 15:13:56 +0100
committerChocobozzz <me@florianbigard.com>2022-02-28 15:13:56 +0100
commitf7ac03ee94d9d32e26bd712e8dc05a6109f5e835 (patch)
treed45e40f4a7e1adb66f24aec5ee18ceae5e8b363a /server/helpers/markdown.ts
parent70a8e50a5d3df90cba615559b5aaba1536356f5a (diff)
downloadPeerTube-f7ac03ee94d9d32e26bd712e8dc05a6109f5e835.tar.gz
PeerTube-f7ac03ee94d9d32e26bd712e8dc05a6109f5e835.tar.zst
PeerTube-f7ac03ee94d9d32e26bd712e8dc05a6109f5e835.zip
Fix client html performance regression
Diffstat (limited to 'server/helpers/markdown.ts')
-rw-r--r--server/helpers/markdown.ts4
1 files changed, 2 insertions, 2 deletions
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')
8const MarkdownItClass = require('markdown-it') 8const MarkdownItClass = require('markdown-it')
9 9
10const markdownItWithHTML = new MarkdownItClass('default', { linkify: true, breaks: true, html: true }) 10const markdownItWithHTML = new MarkdownItClass('default', { linkify: true, breaks: true, html: true })
11const markdownItWithoutHTML = new MarkdownItClass('default', { linkify: true, breaks: true, html: false }) 11const markdownItWithoutHTML = new MarkdownItClass('default', { linkify: false, breaks: true, html: false })
12 12
13const toSafeHtml = (text: string) => { 13const toSafeHtml = (text: string) => {
14 if (!text) return '' 14 if (!text) return ''
@@ -66,7 +66,7 @@ function plainTextPlugin (markdownIt: any) {
66 66
67 if (token.type === 'list_item_close') { 67 if (token.type === 'list_item_close') {
68 lastSeparator = ', ' 68 lastSeparator = ', '
69 } else if (/[a-zA-Z]+_close/.test(token.type)) { 69 } else if (token.type.endsWith('_close')) {
70 lastSeparator = ' ' 70 lastSeparator = ' '
71 } else if (token.content) { 71 } else if (token.content) {
72 text += lastSeparator 72 text += lastSeparator