pngwn / MDsveX

A markdown preprocessor for Svelte.
https://mdsvex.pngwn.io
MIT License
2.27k stars 96 forks source link

Frontmatter containing `$1` is correctly substituted #600

Closed pensono closed 1 month ago

pensono commented 2 months ago

Without this change, the script itself could be inserted into the metadata string.

Before,

---
price: '$10'
---
<script context="module">
</script>

becomes

<script·context="module">
export const metadata = {"price":"<script·context="module">0"};
const {·price·} = metadata;
</script>

The correct behavior is to keep the string as-is:

<script context="module">
export const metadata = {"price":"$10"};
const { price } = metadata;
</script>
changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: 9b71e220d3aac5c40ef1aa77dd275b164f51ba76

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

pngwn commented 1 month ago

Sorry for the delay! Released now https://github.com/pngwn/MDsveX/releases/tag/mdsvex%400.11.1