Skip to content

Commit

Permalink
fix(content-slot): better slot name regex
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 29, 2023
1 parent ff11497 commit 329cf3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module.ts
Expand Up @@ -335,7 +335,7 @@ export default defineNuxtModule<ModuleOptions>({
enforce: 'pre',
transform (code) {
if (code.includes('ContentSlot')) {
code = code.replace(/<ContentSlot (.*)(:use=['"](\$slots.)?([a-z]*)['"]|use=['"]([a-z]*)['"])/g, '<MDCSlot $1 name="$4"')
code = code.replace(/<ContentSlot (.*)(:use=['"](\$slots.)?([a-zA-Z0-9_-]*)['"]|use=['"]([a-zA-Z0-9_-]*)['"])/g, '<MDCSlot $1 name="$4"')
code = code.replace(/<\/ContentSlot>/g, '</MDCSlot>')
code = code.replace(/<ContentSlot/g, '<MDCSlot')
code = code.replace(/(['"])ContentSlot['"]/g, '$1MDCSlot$1')
Expand Down

0 comments on commit 329cf3b

Please sign in to comment.