Skip to content

Commit

Permalink
fix: use regex instead to replace all dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikvilhelmberglund committed Aug 15, 2024
1 parent 4b8f35b commit 3d717fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mdsvex/src/transformers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export function transform_hast({
`export const metadata = ${stringified};${newline}` +
`\tconst { ${Object.keys(metadata)
.join(', ')
.replace('-', '_')} } = metadata;`;
.replace(/-/g, '_')} } = metadata;`;

const frontmatter_layout =
metadata && (metadata.layout as string | undefined | false);
Expand Down

0 comments on commit 3d717fa

Please sign in to comment.