fix: noHighlightRe now wins over languageDetectRe - #4465
Conversation
When a block carries both a matching language-* class and an explicit no-highlight/nohighlight class, the exclusion now takes precedence over language detection. Closes highlightjs#3700
|
So I think this needs to wait for v12... this is a breaking change, yes? In that it could cause existing website to LOSE highlighting in cases where noHighlight would suddenly win - where before it would lose. Yes? |
|
Yes — confirmed breaking, in exactly the direction you describe. The change only affects blocks carrying both a matching
So a site with The narrow scope is worth noting: a lone Given that, I agree this should wait for v12 rather than land on v11. Happy to either keep this PR open to retarget onto a v12 branch when that work starts, or close it for now and reopen at v12 — your call on which is less noise for you. |
Closes #3700\n\nWhen a code block carries both a matching
language-*/lang-*class and an explicitno-highlight/nohighlightclass, the exclusion now takes precedence over language detection.\n\nChanges:\n-blockLanguagechecksshouldNotHighlightbefore runninglanguageDetectRe.\n- Added a test fixture + case covering the mixed-class scenario.\n\nVerified with:\n\n\nnpm run build\nnpm test\nnpm run lint\n\n\nNote: this change was prepared with assistance from Claude (Anthropic).