highlight.js: Add missing overrides, update version, and run at build time#4627
Merged
Conversation
✅ Deploy Preview for wcag2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
iadawn
approved these changes
Sep 23, 2025
(Not bothering to add languages for obsolete techniques, e.g. AS/C#)
523d7a9 to
0f31306
Compare
iadawn
approved these changes
Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this PR:
language-*orno-highlightclasses to code elements inside pre elements where they were missing, to provide stability across highlight.js upgrades in the event of changes to auto-detection logic./techniques/css/C45.html missing "language-*" or "no-highlight" class on <pre><code> starting with <!DOCTYPE html>\n<html lang="en...highlight.jsat build time and including it as an npm dependencyhighlight.min.jsbundle taking up more space in the repo on each updateBefore switching from client-side to build-time, I verified (using the script I'd posted in #4611) that updating the bundle does not cause any syntax highlighting changes, other than adding it for the previously-missing languages.
I also performed screenshot diffs and have verified that the only changes caused by the update are fixes to syntax highlighting (primarily in terms of recognized CSS property names).
I performed screenshot diffs again after switching to build-time highlight.js, and there were only two diffs, in examples that specifically intended to include
<span lang="...">elements inside of<pre><code>. These have been adjusted to applylangto thepretag instead.Note: The failure on the Check PR files check is an extremely rare false positive because I had updated it to consider
scriptnormative, but technically onlyscript/wcag.jsis involved in TR space;script/highlight.min.jsis not. This should never be an issue again, since I'm removinghighlight.min.js.