From 401c1bef7c788dfa94e6f0a81b41c2538fc559b7 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 12 Oct 2026 10:41:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=87=AA=E5=AD=A6):=20=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=20/=20=E4=B8=8B=E4=B8=80=E8=AF=BE=E4=B8=8B=E9=9D=A2?= =?UTF-8?q?=E7=A9=BA=E5=87=BA=E4=B8=80=E5=A4=A7=E6=88=AA=EF=BC=9B=E5=AD=A6?= =?UTF-8?q?=E4=B9=A0=E7=9B=AE=E6=A0=87=E9=87=8C=E7=9A=84=E5=8A=A0=E7=B2=97?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=88=90=E4=B8=A4=E5=AF=B9=E6=98=9F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../src/oj/learn/components/LessonBody.vue | 23 ++++++++++++++++++- apps/web/src/oj/learn/index.vue | 6 +++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/apps/web/src/oj/learn/components/LessonBody.vue b/apps/web/src/oj/learn/components/LessonBody.vue index 501b810..9856df6 100644 --- a/apps/web/src/oj/learn/components/LessonBody.vue +++ b/apps/web/src/oj/learn/components/LessonBody.vue @@ -17,6 +17,16 @@ defineProps<{ const emit = defineEmits<{ solved: [exerciseId: number] }>() const isDark = useDark() + +/** 学习目标那几行只有行内的 **加粗** 和 `代码`,先转义再换成标签,别为它拉一个 MdPreview */ +function inline(text: string) { + return text + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/`([^`]+)`/g, '$1') + .replace(/\*\*([^*]+)\*\*/g, "$1") +}