Repository navigation
[#375] Loaded the 'apache' and 'nginx' highlight.js languages for code blocks. - #377
Merged
Merged
Conversation
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 46 minutes for your next included review. View limit details
|
|
Code coverage (threshold: 80%) Per-class coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #377 +/- ##
===========================================
+ Coverage 87.94% 87.96% +0.01%
===========================================
Files 39 39
Lines 863 864 +1
===========================================
+ Hits 759 760 +1
Misses 104 104 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was successfully deployed
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.
Closes #375
Checklist before requesting a review
[#123] Verb in past tense.#123added to descriptionChangedsectionSummary
Code blocks in
civictheme_rich_textcontent taggedlanguage-apacheorlanguage-nginxnow load their highlight.js grammar, so they render highlighted alongsidelanguage-gherkin.The
highlight_jsmodule loads only the cdnjs 11.9.0 common bundle (highlight.min.js), which has no Apache or Nginx grammar, so a page like the October 2026 PHP vulnerabilities post loggedCould not find the language 'apache'and'nginx'and fell back to plain text. The module'slanguagessetting only fills the editor dialog's dropdown and never attaches a grammar, so this can't be fixed in settings.After merge, any page that attaches
highlight_js/highlight_js.customalso loadsapache.min.jsandnginx.min.jsfrom cdnjs 11.9.0, whichscript-srcincsp.settings.ymlalready admits throughhttps://cdnjs.cloudflare.com. The CKEditor code block language list ineditor.editor.civictheme_rich_text.ymlis unchanged.Before / After
Changed
do_base.libraries.yml: addedhighlight_js.apacheandhighlight_js.nginx, each loading its grammar from cdnjs11.9.0(the same version as the module's core bundle) and depending onhighlight_js/highlight_js.js, like the existinghighlight_js.gherkin.LibraryInfoAlterHook: the extra languages live in aHIGHLIGHT_LANGUAGESconstant, and the hook loops over it to add eachdo_base/highlight_js.<language>dependency tohighlight_js.custom.LibraryInfoAlterHookTest: asserts all 3 dependencies in order, checks each language has a library indo_base.libraries.ymlpointing at the cdnjs URL, and covers another extension'shighlight_js.custombeing left alone.Screenshots
N/A