From 6a32ff3030901e3ca252df7f4a08d4799f5853dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=A2=A6?= Date: Tue, 19 May 2026 20:29:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/src/components/latex-text/index.vue | 10 +++++++++- .../src/components/paper-question-item/index.vue | 7 +++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/playground/src/components/latex-text/index.vue b/playground/src/components/latex-text/index.vue index 3165021..5ca4ed1 100644 --- a/playground/src/components/latex-text/index.vue +++ b/playground/src/components/latex-text/index.vue @@ -20,12 +20,20 @@ const regex_tag = /(<\/span>)/g // 仅匹配合法 HTML 标签,避免将 $a]*)?\s*>)/g +const regex_html_entity = /&(?:#(?:\d+|x[\da-f]+)|[a-z][\da-z]*);/gi + function escapeHtml(text: string) { - return text + const entities: string[] = [] + const protectedText = text.replace(regex_html_entity, (entity) => { + entities.push(entity) + return `\uE000${entities.length - 1}\uE001` + }) + return protectedText .replaceAll('&', '&') .replaceAll('<', '<') .replaceAll('>', '>') .replaceAll('"', '"') + .replace(/\uE000(\d+)\uE001/g, (_, index) => entities[Number(index)]!) } function addLatexText(list: any[], text: string) { diff --git a/playground/src/components/paper-question-item/index.vue b/playground/src/components/paper-question-item/index.vue index 7c46912..c7398b0 100644 --- a/playground/src/components/paper-question-item/index.vue +++ b/playground/src/components/paper-question-item/index.vue @@ -770,10 +770,13 @@ const handleEditSave = async () => { .qml-bk { display: inline-block; - line-height: 0.8; + min-width: 2em; + padding: 0 2px; + line-height: inherit; + vertical-align: baseline; text-align: center; overflow-wrap: break-word; - text-decoration-color: unset !important; + text-decoration: none !important; background-color: #ecf9ff; border-bottom: 1px solid #000; }