Normalize common fenced-language aliases for highlight.js lazy loading#3723
Normalize common fenced-language aliases for highlight.js lazy loading#3723theletterf with Copilot wants to merge 4 commits into
Conversation
| py: 'python', | ||
| rb: 'ruby', | ||
| sh: 'shell', | ||
| ts: 'typescript', |
There was a problem hiding this comment.
@copilot we need more languages here. at least html is also broken
Broken aliases actually used in docs-content / elasticsearch / kibana:
- js
- jsx
- ts
- tsx
- text
- txt
- py
- html
- yml
- jsonc
- md
- cmd
There was a problem hiding this comment.
Updated in 6229ed5.
Added alias normalization for the requested set: js, jsx, ts, tsx, text, txt, py, html, yml, jsonc, md, cmd (plus existing sh/rb), and expanded hljs.test.ts to verify alias→canonical resolution and highlighted output for each.
There was a problem hiding this comment.
wonder if maintaining this separate list will lead to drift / silent bugs in future, but not sure how to fix
I can’t create repo issues from this execution environment (GitHub API permission is blocked here). Please create one and I can add a proposed title/body if useful. |
|
Closing in favour of #3724 |
Code fences using short aliases (notably
ts/js) were treated as unknown after language lazy-loading, so they skipped syntax highlighting while canonical names still worked. This PR restores alias normalization before loader resolution so aliases and canonical IDs behave identically.Root cause
shonly), solanguage-ts/language-jsnever resolved to loadable modules.Change: alias normalization coverage
ensureLanguage():ts -> typescriptjs -> javascriptpy -> pythonrb -> rubyChange: regression coverage
sh,js,ts,py, andrb.Change: release note
docs/changelog/describing restored alias handling for code-fence highlighting.Original prompt
This pull request was created from Copilot chat.