Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace yaml dash with underscore to prevent build error #545

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

henrikvilhelmberglund
Copy link

This PR changes frontmatter dash characters excalidraw-plugin to an underscore excalidraw_plugin to fix building issues if you're importing a .md file with YAML that's not JS compatible. (there may be other characters that are also not allowed but in my case dash was enough)

I think you don't want YAML stuff with dashes anyway in a mdsvex context so this shouldn't matter too much. I would have liked to use replaceAll() but it is only available in ES2021 or higher.

I have no idea how to make a changeset right now, will take a look later.

fixes #544

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2023

🦋 Changeset detected

Latest commit: 3d717fa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mdsvex Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

pkg-pr-new bot commented Aug 15, 2024

commit: 8c14e09

mdsvex

pnpm add https://pkg.pr.new/pngwn/MDsveX/mdsvex@545

pfm-parse

pnpm add https://pkg.pr.new/pngwn/MDsveX/pfm-parse@545

svast

pnpm add https://pkg.pr.new/pngwn/MDsveX/svast@545

svast-stringify

pnpm add https://pkg.pr.new/pngwn/MDsveX/svast-stringify@545

svast-utils

pnpm add https://pkg.pr.new/pngwn/MDsveX/svast-utils@545

svelte-parse

pnpm add https://pkg.pr.new/pngwn/MDsveX/svelte-parse@545

Open in Stackblitz

@henrikvilhelmberglund
Copy link
Author

I forgot this even existed. 🤯

lint detected a million issues for me so I only did it on the file I changed, hopefully it works.

@pngwn
Copy link
Owner

pngwn commented Aug 15, 2024

Hey. Yea sorry. The reason I haven't merged it yet is that I think it would be a breaking change.

@henrikvilhelmberglund
Copy link
Author

It could be but the previous behavior was that if you had metadata with dashes in it the build would just fail. Maybe things have changed though, not even sure that this is needed anymore, but it should be easy to test with for example the excalidraw-plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

YAML metadata with string containing hyphen breaks building
2 participants