aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/core-utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-02-04 10:31:54 +0100
committerChocobozzz <me@florianbigard.com>2022-02-04 10:38:32 +0100
commitc68e2b2d223c57836e04e18105255cf0e10ae75b (patch)
treea40348363efc90464ff44306435d45079b0b7fca /shared/core-utils
parent457c83486ed2037a8cf0e55b06b1ae9370ed4d93 (diff)
downloadPeerTube-c68e2b2d223c57836e04e18105255cf0e10ae75b.tar.gz
PeerTube-c68e2b2d223c57836e04e18105255cf0e10ae75b.tar.zst
PeerTube-c68e2b2d223c57836e04e18105255cf0e10ae75b.zip
Fix plaintext markdown converter
Diffstat (limited to 'shared/core-utils')
-rw-r--r--shared/core-utils/renderer/html.ts10
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 @@
1export function getSanitizeOptions () { 1export 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
26export function getTextOnlySanitizeOptions () {
27 return {
28 allowedTags: [] as string[]
29 }
30}
31
26export function getCustomMarkupSanitizeOptions (additionalAllowedTags: string[] = []) { 32export function getCustomMarkupSanitizeOptions (additionalAllowedTags: string[] = []) {
27 const base = getSanitizeOptions() 33 const base = getDefaultSanitizeOptions()
28 34
29 return { 35 return {
30 allowedTags: [ 36 allowedTags: [