diff --git a/src/runtime/markdown-parser/handler/html.ts b/src/runtime/markdown-parser/handler/html.ts index ba4eff9cf..036aef31b 100644 --- a/src/runtime/markdown-parser/handler/html.ts +++ b/src/runtime/markdown-parser/handler/html.ts @@ -6,7 +6,7 @@ import { getTagName } from './utils' export default function html (h: H, node: any) { const tagName = getTagName(node.value) - if (tagName) { + if (tagName && /[A-Z]/.test(tagName)) { node.value = node.value.replace(tagName, kebabCase(tagName)) } diff --git a/test/features/parser-markdown.ts b/test/features/parser-markdown.ts index 39bd03e32..d73a54234 100644 --- a/test/features/parser-markdown.ts +++ b/test/features/parser-markdown.ts @@ -68,5 +68,19 @@ export const testMarkdownParser = () => { expect(parsed.body).toHaveProperty('children') expect(parsed.body.children.length).toEqual(0) }) + + test('h1 tags', async () => { + const parsed = await $fetch('/api/parse', { + method: 'POST', + body: { + id: 'content:index.md', + content: '