diff --git a/package.json b/package.json index 6b494a68d..634cee4b6 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,15 @@ "@ckeditor/ckeditor5-vue": "^4.0.1", "@symfony/webpack-encore": "^4.1.0", "@tsconfig/node14": "^1.0.1", + "@types/dompurify": "^3.0.5", "bindings": "^1.5.0", "bootstrap": "5.2.3", "chokidar": "^3.5.1", + "dompurify": "^3.1.0", "fork-awesome": "^1.1.7", "jquery": "^3.6.0", "node-sass": "^8.0.0", + "marked": "^12.0.1", "popper.js": "^1.16.1", "postcss-loader": "^7.0.2", "raw-loader": "^4.0.2", @@ -46,7 +49,7 @@ "es6-promise": "^4.2.8", "leaflet": "^1.7.1", "masonry-layout": "^4.2.2", - "mime": "^3.0.0", + "mime": "^4.0.0", "swagger-ui": "^4.15.5", "vis-network": "^9.1.0", "vue": "^3.2.37", diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue index bbad4315c..4c1593aa0 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue @@ -125,7 +125,7 @@ const preprocess = (markdown: string): string => { } const postprocess = (html: string): string => { - DOMPurify.addHook('afterSanitizeAttributes', (node) => { + DOMPurify.addHook('afterSanitizeAttributes', (node: any) => { if ('target' in node) { node.setAttribute('target', '_blank'); node.setAttribute('rel', 'noopener noreferrer'); @@ -140,7 +140,7 @@ const postprocess = (html: string): string => { const convertMarkdownToHtml = (markdown: string): string => { marked.use({'hooks': {postprocess, preprocess}}); - const rawHtml = marked(markdown); + const rawHtml = marked(markdown) as string; return rawHtml; };