-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Support code annotations in fenced markdown code #4610
Comments
Thanks for reporting. Pygments parses the Markdown code block as follows: <span class="gh"># Title <!--- (1) ---></span> Thus, there's no comment for Material for MkDocs to extract and replace with a code annotation. This is an upstream issue, so you can follow up with this with the maintainers of Pygments, but we can only process what we get. For reference, the logic for extraction can be found here: mkdocs-material/src/assets/javascripts/components/content/annotation/list/index.ts Lines 71 to 103 in 59f981e
|
Thanks for the information! Moved this request to a new issue in the pygments project. |
Contribution guidelines
I want to suggest an idea and checked that ...
Description
First, let me provide necessary thanks for mkdocs-material as a big fan and avid user.
As far as I can tell, code annotations do not currently function for fenced markdown code. It is possible that I am missing a way to make this work, but tried several possible markdown comment syntaxes to make this work.
In fenced code, I would expect to be able to add an annotation to markdown fenced code using the standard markdown comment syntax (
<!--- comment --->
), e.g. (remove the\
characters):Use Cases
As with all fenced code, annotations provide a powerful way to provide additional detail for users without cluttering the page/code block. Having this feature for markdown fenced code would expand the already beneficial feature to even more use cases.
Screenshots / Mockups
Current behavior of the minimal example above:
The text was updated successfully, but these errors were encountered: