mattjennings / mdsvexamples

Render your Svelte code blocks in MDSveX
31 stars 2 forks source link

Meta parsing correction #17

Closed jjagielka closed 1 year ago

jjagielka commented 1 year ago

Customization: meta tags example shows: ```svelte example foo bar="baz" and that works, but it will fail on: ```svelte example foo bar="baz with spaces"

Working with tailwindcss you need the sequences of classes to be passed around and I need to pass them to my wrapper. So I need something like: ```svelte example class="text-center bg-red-300 inline-flex"

Looking around, I've found: https://stackoverflow.com/questions/16261635/javascript-split-string-by-space-but-ignore-space-in-quotes-notice-not-to-spli

That PR updates the parseMeta function with the ability to keep the quoted text together.

indaco commented 1 year ago

It works like a charme!

Hope it will be merged soon.

mattjennings commented 1 year ago

Thanks for the fix! I've released it as 0.3.2.