Closed vndroid closed 4 months ago
Looks like the docs are just wrong. That alias isn't mentioned in the source, so I'll leave this as an open issue. Should be easy for anyone wanting to make a PR to fix.
Is it possible to add this alias manually? Otherwise, I need to make changes in multiple places in multiple documents. It is too complicated, the Best solution is for the project to add this alias as that documentation. I hope so.
Is it possible to add this alias manually?
https://highlightjs.readthedocs.io/en/latest/api.html#registerlanguage
Sure, use registerLanguage
and getLanguage
... just get it, then re-register it with whatever aliases you like.
the Best solution is for the project to add this alias as that documentation.
Or remove the mention of it entirely... my worry is if we add zsh we then have to add a zillion other aliases to sh
... we may want to do that, or not. I'm thinking on it.
Okay, I see, but I would still suggest adding the common few sh aliases, such as 'sh', otherwise it should be named shell.
sh
is already an alias
Sorry, I meant other common shells like sh
, zsh
, ash
and so on. But it's unnecessary to include all the shells, just a few of the most commonly used ones.
This issue can be closed, it was fixed in #3945.
But as ZSH and BASH can have different syntaxes, I wonder if a separate config should be required or if it's similar enough 99% of the time.
I'd say similar enough - for now at least.
Describe the issue
Example code:
According to the Official Docs:
I had already loaded the js and depends.
Which language seems to have the issue?
Other languages seem to work well. Only the 'zsh' can not be rendered. What is wrong with it?
Java: worked![CleanShot 2023-12-16 at 15 40 44@2x](https://github.com/highlightjs/highlight.js/assets/15273693/54b84709-c9ae-4b5b-8397-44de88f3a83e)
Zsh: not work![CleanShot 2023-12-16 at 15 41 02@2x](https://github.com/highlightjs/highlight.js/assets/15273693/054593f9-8393-41ba-a4f7-61107d5ed7d5)
The console output:
Are you using
highlight
orhighlightAuto
?Yes
Additional context
Do you need to add any other information?