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; }