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

Bugfix/extra whitespace in code #12570

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

Conversation

GrimLink
Copy link

Changes

This fixes the extra line added in the code blocks as reported in #12515 using the same method as seen in shikijs/shiki#585 as suggested by @bluwy

Now this option is enabled by default, same as seen in shiki, but can be disabled trough a option.

Testing

Testing was done manually in my own Astro project and I made sure to run both pnpm run build and pnpm run test to see that this PR had no impact on one of the actions.

This change also does not include any new tests in the @astrojs/markdown-remark package,
since this option works similar to the wrap option, which also has no test.

Docs

A update to the docs will be needed, since this adds a new option to opt out of this behavior.

/cc @withastro/maintainers-docs for feedback!

This is a similar solution as seen in shikijs/shiki#585
Copy link

changeset-bot bot commented Nov 30, 2024

🦋 Changeset detected

Latest commit: ad62af1

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

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

@github-actions github-actions bot added feat: markdown Related to Markdown (scope) pkg: integration Related to any renderer integration (scope) labels Nov 30, 2024
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd lean on removing the option for now and remove the new line always. It seems like a sensible default. Maybe if there's a reported issue in the future we can re-evaluate adding a new option again.

bluwy

This comment was marked as duplicate.

@GrimLink GrimLink force-pushed the bugfix/extra-whitespace-in-code branch from 818f8ac to e52591a Compare December 3, 2024 12:51
@github-actions github-actions bot removed the pkg: integration Related to any renderer integration (scope) label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: markdown Related to Markdown (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants