修正聊天标题层级字号

使用 Tailwind 重要性修饰覆盖全局标题样式
恢复 H1 到 H3 的清晰字号层级
This commit is contained in:
2026-09-04 13:25:56 +08:00
parent 11b137f9c0
commit 1ce50ab031
@@ -106,13 +106,24 @@ const markdownComponents: Components = {
a: ({ children }) => children,
img: ({ alt }) => (alt?.trim() ? `图片:${alt}` : '图片已省略'),
h1: ({ children }) => (
<h1 className="m-0 mt-4 text-xl font-bold first:mt-0">{children}</h1>
<h1 className="m-0 mt-4 !text-xl font-bold first:mt-0">{children}</h1>
),
h2: ({ children }) => (
<h2 className="m-0 mt-4 text-lg font-bold first:mt-0">{children}</h2>
<h2 className="m-0 mt-4 !text-lg font-bold first:mt-0">{children}</h2>
),
h3: ({ children }) => (
<h3 className="m-0 mt-3 text-base font-semibold first:mt-0">{children}</h3>
<h3 className="m-0 mt-3 !text-base font-semibold first:mt-0">{children}</h3>
),
h4: ({ children }) => (
<h4 className="m-0 mt-3 !text-sm font-semibold first:mt-0">{children}</h4>
),
h5: ({ children }) => (
<h5 className="m-0 mt-2 !text-sm font-medium first:mt-0">{children}</h5>
),
h6: ({ children }) => (
<h6 className="m-0 mt-2 !text-xs font-medium uppercase tracking-wide first:mt-0">
{children}
</h6>
),
p: MarkdownParagraph,
ul: MarkdownUnorderedList,