File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
libs/blog-bff/articles/api/src/lib Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,13 @@ export const toArticle = (dto?: WPPostDetailsDto): Article => {
45
45
const title = cheerio . load ( dto . title . rendered || '' ) ;
46
46
47
47
const content = sanitizeHtml ( dto ?. content . rendered || '' , {
48
- allowedTags : sanitizeHtml . defaults . allowedTags . concat ( [ 'img' , 'iframe' ] ) ,
48
+ allowedTags : sanitizeHtml . defaults . allowedTags . concat ( [
49
+ 'img' ,
50
+ 'iframe' ,
51
+ 'script' ,
52
+ ] ) ,
53
+ allowVulnerableTags : true ,
54
+ allowedScriptHostnames : [ 'platform.twitter.com' ] ,
49
55
allowedAttributes : {
50
56
img : [
51
57
'src' ,
@@ -60,8 +66,10 @@ export const toArticle = (dto?: WPPostDetailsDto): Article => {
60
66
] ,
61
67
a : [ 'href' ] ,
62
68
iframe : [ 'src' ] ,
69
+ script : [ 'src' , 'async' , 'charset' ] ,
63
70
} ,
64
71
allowedClasses : {
72
+ blockquote : [ 'twitter-tweet' ] ,
65
73
pre : [ 'lang:*' ] ,
66
74
div : [ 'crayon-line' , 'crayon-syntax' ] ,
67
75
} ,
You can’t perform that action at this time.
0 commit comments