From c8d9b97ab79aa0586eb04394798bbac83267294f Mon Sep 17 00:00:00 2001 From: raizasafeel <89463672+raizasafeel@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:01:48 +0530 Subject: [PATCH] refactor: reuse function 'escapehtml' from utils --- frontend/src/utils/markdownParser.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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]'