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:
parent
70a8e50a5d
commit
f7ac03ee94
3 changed files with 16 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue