diff --git a/packages/mdsvex/src/transformers/index.ts b/packages/mdsvex/src/transformers/index.ts index a992fcca..f51fb617 100644 --- a/packages/mdsvex/src/transformers/index.ts +++ b/packages/mdsvex/src/transformers/index.ts @@ -380,7 +380,7 @@ export function transform_hast({ // @ts-ignore _module[0].value = _module[0].value.replace( RE_MODULE_SCRIPT, - `$1${newline}\t${fm}` + (match: string) => `${match}${newline}\t${fm}` ); } diff --git a/packages/mdsvex/test/_fixtures/hybrid/input/dollar-one-in-frontmatter.svx b/packages/mdsvex/test/_fixtures/hybrid/input/dollar-one-in-frontmatter.svx new file mode 100644 index 00000000..61127b3e --- /dev/null +++ b/packages/mdsvex/test/_fixtures/hybrid/input/dollar-one-in-frontmatter.svx @@ -0,0 +1,5 @@ +--- +price: '$10' +--- + \ No newline at end of file diff --git a/packages/mdsvex/test/_fixtures/hybrid/output/dollar-one-in-frontmatter.svelte b/packages/mdsvex/test/_fixtures/hybrid/output/dollar-one-in-frontmatter.svelte new file mode 100644 index 00000000..5ff48efc --- /dev/null +++ b/packages/mdsvex/test/_fixtures/hybrid/output/dollar-one-in-frontmatter.svelte @@ -0,0 +1,4 @@ +