aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-31 10:07:38 +0100
committerChocobozzz <me@florianbigard.com>2022-01-31 10:07:38 +0100
commit228d8e8e47e913fc6487a917d43a59070aefa0ab (patch)
treed19b21565d4d60d57ffd06a3d5751d04f0263a33 /server/helpers
parentebe4b3df5c4e595f3fcf92b8ecf6c5174b13b3b0 (diff)
downloadPeerTube-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.ts4
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,
10markdownIt.enable(TEXT_WITH_HTML_RULES) 10markdownIt.enable(TEXT_WITH_HTML_RULES)
11markdownIt.use(markdownItEmoji) 11markdownIt.use(markdownItEmoji)
12 12
13const toSafeHtml = text => { 13const 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
26const mdToPlainText = text => { 26const 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