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

Fixes rendering of HTML comments inside markdown code blocks #3638

Merged
merged 3 commits into from
Jun 20, 2022

Conversation

tony-sull
Copy link
Contributor

Closes #3460

Changes

Fixes a bug where HTML comments weren't being rendered properly inside markdown code blocks

Testing

Added tests to the markdown/remark and vite-plugin-markdown packages to test the remark plugin and markdown page rendering

Docs

None, bug fix only

@changeset-bot
Copy link

changeset-bot bot commented Jun 18, 2022

🦋 Changeset detected

Latest commit: a10a873

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

This PR includes changesets to release 1 package
Name Type
@astrojs/markdown-remark 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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) feat: markdown Related to Markdown (scope) labels Jun 18, 2022
@tony-sull tony-sull self-assigned this Jun 18, 2022
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix.

@natemoo-re
Copy link
Member

Going to cc @hippotastic as I know they were working on a lower-level fix to this issue.

@hippotastic
Copy link
Contributor

I think that's a good quick fix for this particular side effect of our current way to allow HTML comments. LGTM!

The fix I'm working on has a far greater scope and will improve interleaving of Markdown and HTML/JSX elements as well as JS expressions in general. There are plenty of scenarios that currently throw parser errors (also with HTML comments), which will become valid afterwards. But this takes some time, and having a quick fix for a single common scenario like this one in the meanwhile is great in my opinion!

@tony-sull
Copy link
Contributor Author

Thanks for the reviews! Very excited to see what you're cooking up, @hippotastic!

@tony-sull tony-sull merged commit 80c71c7 into main Jun 20, 2022
@tony-sull tony-sull deleted the fix/md-comments-in-code branch June 20, 2022 17:12
@github-actions github-actions bot mentioned this pull request Jun 20, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
…ro#3638)

* JS comment wrappers should be removed from HTML comments in code blocks

* chore: add changeset
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) pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Braces are displayed when using HTML comments in Markdown code fences.
3 participants