1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Fix client html performance regression

This commit is contained in:
Chocobozzz 2022-02-28 15:13:56 +01:00
parent 70a8e50a5d
commit f7ac03ee94
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 16 additions and 6 deletions

View file

@ -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