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

Comma delimited info string language #328

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

Conversation

CosmicHorrorDev
Copy link
Contributor

Fixes #246

Changes the syntect plugin to split off any text following a comma from the language tag to match what is supported by rustdoc and GitHub. This now accepts ```rust,no_run as Rust code

```\n\
",
"\
<pre style=\"background-color:#2b303b;\"><code class=\"language-rust,ignore\">\
Copy link

Choose a reason for hiding this comment

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

This still has class="language-rust,ignore", so it wouldn't match anything looking for the class language-rust.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see now that this doesn't fit your use case. Changing that would differ from cmark-gfm's output, but I should be able to add that functionality behind a parse option instead

I'll work on handling that today

Copy link

Choose a reason for hiding this comment

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

It does match GitHub's behavior though, so maybe cmark-gfm has a bug 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

My guess is that GitHub uses the full-info-string option (which gives the full info string, not just the first word) and then parses the language out themselves. That's what we do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure on how to proceed, so I'll just be awaiting more definitive feedback

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.

Option to treat , as a word delimiter for info-strings
3 participants