diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-31 10:07:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-31 10:07:38 +0100 |
commit | 228d8e8e47e913fc6487a917d43a59070aefa0ab (patch) | |
tree | d19b21565d4d60d57ffd06a3d5751d04f0263a33 /server/helpers | |
parent | ebe4b3df5c4e595f3fcf92b8ecf6c5174b13b3b0 (diff) | |
download | PeerTube-228d8e8e47e913fc6487a917d43a59070aefa0ab.tar.gz PeerTube-228d8e8e47e913fc6487a917d43a59070aefa0ab.tar.zst PeerTube-228d8e8e47e913fc6487a917d43a59070aefa0ab.zip |
Convert markdown to html/plain text for feeds
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/markdown.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/markdown.ts b/server/helpers/markdown.ts index ebf479b98..0b8c2fabc 100644 --- a/server/helpers/markdown.ts +++ b/server/helpers/markdown.ts | |||
@@ -10,7 +10,7 @@ const markdownIt = new MarkdownItClass('default', { linkify: true, breaks: true, | |||
10 | markdownIt.enable(TEXT_WITH_HTML_RULES) | 10 | markdownIt.enable(TEXT_WITH_HTML_RULES) |
11 | markdownIt.use(markdownItEmoji) | 11 | markdownIt.use(markdownItEmoji) |
12 | 12 | ||
13 | const toSafeHtml = text => { | 13 | const toSafeHtml = (text: string) => { |
14 | if (!text) return '' | 14 | if (!text) return '' |
15 | 15 | ||
16 | // Restore line feed | 16 | // Restore line feed |
@@ -23,7 +23,7 @@ const toSafeHtml = text => { | |||
23 | return sanitizeHtml(html, sanitizeOptions) | 23 | return sanitizeHtml(html, sanitizeOptions) |
24 | } | 24 | } |
25 | 25 | ||
26 | const mdToPlainText = text => { | 26 | const mdToPlainText = (text: string) => { |
27 | if (!text) return '' | 27 | if (!text) return '' |
28 | 28 | ||
29 | // Convert possible markdown (emojis, emphasis and lists) to html | 29 | // Convert possible markdown (emojis, emphasis and lists) to html |