Skip to content

Commit 329cf3b

Browse files
committed
fix(content-slot): better slot name regex
1 parent ff11497 commit 329cf3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export default defineNuxtModule<ModuleOptions>({
335335
enforce: 'pre',
336336
transform (code) {
337337
if (code.includes('ContentSlot')) {
338-
code = code.replace(/<ContentSlot (.*)(:use=['"](\$slots.)?([a-z]*)['"]|use=['"]([a-z]*)['"])/g, '<MDCSlot $1 name="$4"')
338+
code = code.replace(/<ContentSlot (.*)(:use=['"](\$slots.)?([a-zA-Z0-9_-]*)['"]|use=['"]([a-zA-Z0-9_-]*)['"])/g, '<MDCSlot $1 name="$4"')
339339
code = code.replace(/<\/ContentSlot>/g, '</MDCSlot>')
340340
code = code.replace(/<ContentSlot/g, '<MDCSlot')
341341
code = code.replace(/(['"])ContentSlot['"]/g, '$1MDCSlot$1')

0 commit comments

Comments
 (0)