Skip to content

Commit bd9e15b

Browse files
committed
fix(renderer): bundle prose/alias components
1 parent 7d87f7e commit bd9e15b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/module.ts

+9
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
330330
...Object.values(options.renderer.alias || {}),
331331
...new Set(tags),
332332
]
333+
.map(tag => getMappedTag(tag, options?.renderer?.alias))
333334
.filter(tag => !htmlTags.includes(kebabCase(tag)))
334335
.map(tag => pascalCase(tag))
335336

@@ -342,3 +343,11 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
342343
components: uniqueTags,
343344
}
344345
}
346+
347+
const proseTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'a', 'strong', 'em', 's', 'code', 'span']
348+
function getMappedTag(tag: string, additionalTags: Record<string, string> = {}) {
349+
if (proseTags.includes(tag)) {
350+
return `prose-${tag}`
351+
}
352+
return additionalTags[tag] || tag
353+
}

0 commit comments

Comments
 (0)