highlightjs / highlightjs/highlight.js

`noHighlightRe` should win out over `languageDetectRe`

Open
#3,700 12 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue help welcome parser version-12
Dominant language
JavaScript
Stars
25k
Forks
3.8k
Avg merge
11h 35m
Merged PRs (30d)
3

Description

If a class name matches `noHighlightRe` it should always be ignored - even if it otherwise looks correct and is also a match of `languageDetectRe`... this would allow you to use `lang-*` as your detect match but then also have an exclude list in the `noHightlightRe` regex.

IE, the block list overrides the allow list. This is an edge case. If no one steps up to work on this before v12 this will auto-close as it's such a small edge case (and also a breaking change).

---

**Is your request related to a specific problem you're having?**
I am using highlight.js to with "hljs.highlightAll()", and get these warnings.
![image](https://user-images.githubusercontent.com/10484271/214452682-73090005-0e57-4c83-872e-04f1e4f45b70.png)

**The solution you'd prefer / feature you'd like to see added...**
an option like: excluded-languages: {mermaid, ...}
or an option to disable these warnings.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.