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

Ensure to strip any code block annotation after language name #46

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

Conversation

anlambert
Copy link

Some markdown files can contain extra code block annotations after the language name, separated by commas.

Such extra annotations break code highlighting after processing by showdown-highlight as the language name ends up invalid and cannot be found by highlight.js.

For instance, the README of https://github.com/budziq/rust-skeptic repository contains such code block annotations and we can see they are properly rendered by GitHub. However, when browsing the archived version of that repository in Software Heritage, whose website uses showdownjs and showdown-highlight, we can see the renderings of such code blocks are broken.

So ensure to strip these extra annotations to fix HTML rendering.

I also added a GitHub Actions job to execute the tests of showdown-highlight.

@anlambert anlambert force-pushed the ensure-code-block-annotation-strip branch from cb3472e to bda5853 Compare August 23, 2024 14:35
Some markdown files can contain extra code block annotations after
the language name, separated by commas.

Such extra annotations break code highlighting after processing
by showdown-highlight as the language name ends up invalid and
cannot be found by highlight.js.

So ensure to strip these extra annotations to fix HTML rendering.
@anlambert anlambert force-pushed the ensure-code-block-annotation-strip branch from bda5853 to bc7e24e Compare August 23, 2024 20:46
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