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

Weird heading id generated for MD heading with curly braces #5781

Closed
1 task
fflaten opened this issue Jan 6, 2023 · 3 comments
Closed
1 task

Weird heading id generated for MD heading with curly braces #5781

fflaten opened this issue Jan 6, 2023 · 3 comments
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: markdown Related to Markdown (scope)

Comments

@fflaten
Copy link
Contributor

fflaten commented Jan 6, 2023

What version of astro are you using?

1.9.0

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

Using curly braces in a heading in a .md file generates an function-like heading-id.

Example:

# Some weird heading like { }

<!-- becomes -->
<h1 id="{$$slug(&#x60;Some" weird="" heading="" like="" ${="" }&#x60;)}="">Some weird heading like { }</h1>

Repro: Build and check /dist/markdown/index.html

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-cbd34s

Participation

  • I am willing to submit a pull request for this issue.
@delucis
Copy link
Member

delucis commented Jan 9, 2023

The code that injected the strange $$slug string was removed as part of #5785, so this will be fixed in the next 2.0 beta release. Not sure if we need to backport anything to v1 or if it’s OK to say, “Upgrade to v2 to get the fix.”

@delucis delucis added feat: markdown Related to Markdown (scope) - P2: nice to have Not breaking anything but nice to have (priority) labels Jan 9, 2023
@fflaten
Copy link
Contributor Author

fflaten commented Jan 9, 2023

Great, thanks!

Not sure if we need to backport anything to v1 or if it’s OK to say, “Upgrade to v2 to get the fix.”

I'd vote for v2-only until more reports. Easy upgrade path and not critical.

@delucis
Copy link
Member

delucis commented Jan 9, 2023

Cool, I think I agree, so will close as fixed. Thanks again for raising this and #5780 🙌

@delucis delucis closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: markdown Related to Markdown (scope)
Projects
None yet
Development

No branches or pull requests

2 participants