shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.08k stars 53 forks source link

Remove trailing newline in code blocks before twoslash processing #93

Closed ayazhafiz closed 3 years ago

ayazhafiz commented 3 years ago

markdown-it's parser produces code blocks with a trailing newline, seemingly in conformance with the commonmark spec. shiki-twoslash should avoid treating this line as contentful, as doing so results in generated html with a "line" for that newline, adding an extra newline to the user-provided code block. To avoid this unexpected behavior, simply remove the trailing newline before twoslash-shiki processing.

Closes #90

changeset-bot[bot] commented 3 years ago

🦋 Changeset detected

Latest commit: 372ef2664a57738fe1257b49463bc57292d302ff

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

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | markdown-it-shiki-twoslash | Major |

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

ayazhafiz commented 3 years ago

I guess this is a breaking change but I'm not sure what is preferred regarding creating a changeset or any other versioning changes? Any guidance is appreciated.

orta commented 3 years ago

I can handle versioning 👍🏻

Maximvdw commented 3 years ago

I think this issue is similar in the eleventy plugin newline issue