diff --git a/frontend/src/utils/markdownParser.js b/frontend/src/utils/markdownParser.js index 493bcb47..e11f2a13 100644 --- a/frontend/src/utils/markdownParser.js +++ b/frontend/src/utils/markdownParser.js @@ -1,5 +1,6 @@ import { CodeXml } from 'lucide-vue-next' import { createApp, h } from 'vue' +import { escapeHTML } from '@/utils' export class Markdown { constructor({ data, api, readOnly, config }) { @@ -301,7 +302,7 @@ export class Markdown { _parseInlineMarkdown(text) { if (!text) return '' - let html = this._escapeHtml(text) + let html = escapeHTML(text) html = html.replace(/`([^`]+)`/g, '$1') @@ -316,15 +317,6 @@ export class Markdown { return html } - _escapeHtml(text) { - return text - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') - } - _togglePlaceholder() { const blocks = document.querySelectorAll( '.cdx-block.ce-paragraph[data-placeholder]'