refactor: 将页面的Markdown渲染改为HTML渲染 #79

Manually merged
remilia merged 5 commits from feat/html-render into master 2025-11-14 11:49:02 +08:00
2 changed files with 12 additions and 2 deletions
Showing only changes of commit 100b79f99b - Show all commits

View File

@ -11,7 +11,11 @@
<p class="solution-summary">{{ solution.summary }}</p>
</header>
<section class="solution-content">
<markdown-renderer :content="solution?.content || ''" />
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="solution?.content || ''" />
<div v-else>
<HtmlRenderer class="html-typography" :html="solution.content || ''" />
</div>
</section>
</article>
</template>
@ -23,6 +27,12 @@
default: null,
},
});
const hydrated = ref(false);
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>

View File

@ -8,7 +8,7 @@
:title="question.title"
:name="question.id"
>
<!-- <markdown-renderer :content="question.content || ''" /> -->
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="question.content" />
<div v-else>
<HtmlRenderer