fix: expand hljs language coverage via alias resolution#378
Merged
tomasz-tomczyk merged 1 commit intomainfrom Apr 28, 2026
Merged
fix: expand hljs language coverage via alias resolution#378tomasz-tomczyk merged 1 commit intomainfrom
tomasz-tomczyk merged 1 commit intomainfrom
Conversation
Replace hand-curated extension map with hljs.getLanguage() alias lookup plus a small overrides map for cases where the file extension is not a registered hljs alias. Adds Gherkin (.feature) and many others previously missing. Adds an E2E test for Gherkin highlighting and a sample .feature file in the fixture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #378 +/- ##
==========================================
+ Coverage 66.56% 66.59% +0.03%
==========================================
Files 19 19
Lines 8176 8176
==========================================
+ Hits 5442 5445 +3
+ Misses 2311 2309 -2
+ Partials 423 422 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
langFromPathwithhljs.getLanguage()alias resolution plus a small override map for extensions hljs doesn't alias (tf,htm,svg,cs,sh,zig,md).Dockerfile,Makefile,Gemfile,Rakefile..feature) and many other languages that were already bundled inhighlight.min.jsviacopy-deps.jsbut unreachable through the dispatcher.lang !== 'markdown'guard atapp.js:880(avoids messy nested```markdownrendering when reviewing a top-level.mdfile). Hencemd → markdownstays in the override map so downstreamlang === 'markdown'comparisons keep working.Related to #375.
Review
Test plan
e2e/tests/syntax-highlighting.spec.tsasserts hljs spans render on a.featurefilee2e/setup-fixtures.shfile-tree.spec.tsandscope-toggle.spec.ts🤖 Generated with Claude Code