From a98e7cf9a2b75ea3de86f34f5eca7876838c7160 Mon Sep 17 00:00:00 2001 From: moris Date: Sun, 15 Dec 2024 22:41:18 +0900 Subject: [PATCH] =?UTF-8?q?add:=20katex=E3=82=92mathml=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/Markdown.css | 7 +------ src/lib/components/Markdown.svelte | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lib/components/Markdown.css b/src/lib/components/Markdown.css index c93143a..8e15d81 100644 --- a/src/lib/components/Markdown.css +++ b/src/lib/components/Markdown.css @@ -161,13 +161,8 @@ width: 60%; } } - & .katex-html { - display: none; - } - & .katex-display { - & math { + & math[display="block"] { margin: 1rem; font-size: 1.5rem; - } } } \ No newline at end of file diff --git a/src/lib/components/Markdown.svelte b/src/lib/components/Markdown.svelte index ebad218..4428357 100644 --- a/src/lib/components/Markdown.svelte +++ b/src/lib/components/Markdown.svelte @@ -24,7 +24,7 @@ .use(remarkmath) // 数式 .use(remarkRehype, {allowDangerousHtml: true}) .use(rehypeslug) // headingにidを設定 - .use(rehypeKatex) // 数式 + .use(rehypeKatex, {output:'mathml'}) // 数式 .use(rehypeHighlight)// Syntax highlight .use(rehypeExternalLinks, {target:'_blank', rel:['noreferrer','noopener']})// 外部サイトを新規タブで開く .use(rehypeStringify, {allowDangerousHtml: true})