mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-05 07:19:49 +00:00
Add use of DOMPurify to sanitize text from possible injection
This commit is contained in:
parent
cd793d6842
commit
8363c5c3cf
@ -30,6 +30,8 @@ import { onMounted, ref } from 'vue'
|
||||
import {makeFetch} from "ChillMainAssets/lib/api/apiMethods";
|
||||
import Modal from '../../_components/Modal.vue'; // Adjust the import path
|
||||
import { marked } from 'marked';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
|
||||
|
||||
const newsItems = ref([])
|
||||
@ -59,7 +61,11 @@ const truncateContent = (content, maxLength = 100) => {
|
||||
};
|
||||
|
||||
const convertMarkdownToHtml = (markdown) => {
|
||||
return marked(markdown);
|
||||
const rawHtml = marked(markdown);
|
||||
return rawHtml;
|
||||
/* console.log('rawhtml', rawHtml)
|
||||
console.log('sanitized', DOMPurify.sanitize(rawHtml))
|
||||
return DOMPurify.sanitize(rawHtml)*/
|
||||
};
|
||||
|
||||
const truncateMarkdownContent = (content, maxLength = 100) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user