diff options
author | Chocobozzz <me@florianbigard.com> | 2022-02-04 10:31:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-02-04 10:38:32 +0100 |
commit | c68e2b2d223c57836e04e18105255cf0e10ae75b (patch) | |
tree | a40348363efc90464ff44306435d45079b0b7fca /shared/core-utils/renderer | |
parent | 457c83486ed2037a8cf0e55b06b1ae9370ed4d93 (diff) | |
download | PeerTube-c68e2b2d223c57836e04e18105255cf0e10ae75b.tar.gz PeerTube-c68e2b2d223c57836e04e18105255cf0e10ae75b.tar.zst PeerTube-c68e2b2d223c57836e04e18105255cf0e10ae75b.zip |
Fix plaintext markdown converter
Diffstat (limited to 'shared/core-utils/renderer')
-rw-r--r-- | shared/core-utils/renderer/html.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/shared/core-utils/renderer/html.ts b/shared/core-utils/renderer/html.ts index c9757be85..502308979 100644 --- a/shared/core-utils/renderer/html.ts +++ b/shared/core-utils/renderer/html.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | export function getSanitizeOptions () { | 1 | export function getDefaultSanitizeOptions () { |
2 | return { | 2 | return { |
3 | allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ], | 3 | allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ], |
4 | allowedSchemes: [ 'http', 'https' ], | 4 | allowedSchemes: [ 'http', 'https' ], |
@@ -23,8 +23,14 @@ export function getSanitizeOptions () { | |||
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | export function getTextOnlySanitizeOptions () { | ||
27 | return { | ||
28 | allowedTags: [] as string[] | ||
29 | } | ||
30 | } | ||
31 | |||
26 | export function getCustomMarkupSanitizeOptions (additionalAllowedTags: string[] = []) { | 32 | export function getCustomMarkupSanitizeOptions (additionalAllowedTags: string[] = []) { |
27 | const base = getSanitizeOptions() | 33 | const base = getDefaultSanitizeOptions() |
28 | 34 | ||
29 | return { | 35 | return { |
30 | allowedTags: [ | 36 | allowedTags: [ |