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

Feature: Add option to ignore languages #69

Closed
wants to merge 6 commits into from

Conversation

lacrioque
Copy link

Short:

Added an option to skip language highlighting.

Reason:

While working on an internal documentation system, we came across an issue with mermaid-graph rendering and language highlighting. We wanted highlighting for the code examples, but the mermaid graphs should be painted.
There was no easy way to achieve this, through editing the Prism configuration, so I added an option to filter out specific languages from being rendered out.

Solution:

Additional optional setting `languageFilter´.
Default assignment is an empty array, so it will not impact running Installations. This change should be fully backwards compatible.
In the highlighting modules (HighlightPairedShortcode, markdownSyntaxHighlightOption) the language will be checked before any linting, or reading action. It checks if the language is included in the option array. If it is a plain "

" will be returned with the language as class and any additional preAttributes set as option.

@zachleat
Copy link
Member

Hey, just reading the Mermaid docs https://mermaid-js.github.io/mermaid/#/usage it looks like any element with class="mermaid" on it gets passed to the mermaid API—how do you differentiate between a code block that wants to be syntax highlighted in mermaid and a code block that should be rendered in mermaid? Also reviewing https://traveling-coderman.net/code/eleventy-mermaid/ which seemed to use a mermaid-graph lang

I’m also curious if #50 already solved this without filtering.

@zachleat zachleat added the open-question Further information is requested from the original poster. label Jun 28, 2022
@zachleat
Copy link
Member

This is an automated message to let you know that this issue requires additional input from the original poster and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

Do not let the issue’s closing deter you. After you’ve supplied the required information, the issue will be reopened. Thanks!

@zachleat zachleat closed this Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-question Further information is requested from the original poster.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants