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

Prevent accidental conflict between IDs by Markdown headings and internal IDs for preview #348

Merged
merged 3 commits into from
Apr 22, 2022

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Apr 22, 2022

Marp preview had used <div id="marp-vscode"> and <style id="marp-vscode-style"> to show the preview.

The default Markdown preview by VS Code will automatically generate ID from the heading content, so this line (generates <h1 id="marp-vscode">) can break Markdown preview easily:

# marp-vscode

I've updated to use #__marp-vscode and #__marp-vscode-style instead. __ prefix is mostly safe in preview because it will not be generated as heading slug.

@yhatt yhatt changed the title Prevent accidental conflict of HTML IDs by Markdown with internal IDs for preview Prevent accidental conflict between IDs by Markdown headings and internal IDs for preview Apr 22, 2022
@yhatt yhatt merged commit e387700 into main Apr 22, 2022
@yhatt yhatt deleted the prevent-accidental-conflict-with-id branch April 22, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant