aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils/renderer/markdown.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-17 14:34:09 +0100
committerChocobozzz <me@florianbigard.com>2020-11-17 14:34:09 +0100
commit9ff36c2d70956d2775d207c7809adb6fe7f2f2a5 (patch)
treec9058f8210d9674b69307c4f7c5ccde85a1ba597 /shared/core-utils/renderer/markdown.ts
parent9afb5c10e5935e667e33219bdbd775e9ed1b4330 (diff)
downloadPeerTube-9ff36c2d70956d2775d207c7809adb6fe7f2f2a5.tar.gz
PeerTube-9ff36c2d70956d2775d207c7809adb6fe7f2f2a5.tar.zst
PeerTube-9ff36c2d70956d2775d207c7809adb6fe7f2f2a5.zip
Refactor markdown/sanitize html code
Diffstat (limited to 'shared/core-utils/renderer/markdown.ts')
-rw-r--r--shared/core-utils/renderer/markdown.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/shared/core-utils/renderer/markdown.ts b/shared/core-utils/renderer/markdown.ts
new file mode 100644
index 000000000..dff746d87
--- /dev/null
+++ b/shared/core-utils/renderer/markdown.ts
@@ -0,0 +1,23 @@
1export const TEXT_RULES = [
2 'linkify',
3 'autolink',
4 'emphasis',
5 'link',
6 'newline',
7 'list'
8]
9
10export const TEXT_WITH_HTML_RULES = TEXT_RULES.concat([
11 'html_inline',
12 'html_block'
13])
14
15export const ENHANCED_RULES = TEXT_RULES.concat([ 'image' ])
16export const ENHANCED_WITH_HTML_RULES = TEXT_WITH_HTML_RULES.concat([ 'image' ])
17
18export const COMPLETE_RULES = ENHANCED_WITH_HTML_RULES.concat([
19 'block',
20 'inline',
21 'heading',
22 'paragraph'
23])