-
Notifications
You must be signed in to change notification settings - Fork 3.6k
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for registerAlias
similar to registerLanguage
#2523
Comments
FYI: You can do this now by just getting a languages raw interface and re-registering the language (which will update it's aliases). I'm not opposed to a simple registerAlias method though:
Though I wonder if I don't think the second form that you support is necessary at all since it seems an edge case and easy enough to write a loop. And if we added this we'd of course need to add docs for it. Want to make a PR? |
The reason for The reason for the other option is so that a module could expose that mapping between highlightjs names and GH aliases as an object, which could be required and then directly passed. |
I don't love Sure, but you can write 2 lines of code to use |
@wooorm You willing to whip up a PR for this one? |
I’m a bit swamped at the moment; if @taufik-nurrohman is interested, I would be grateful! |
Closing as resolved by #2540 |
Is your request related to a specific problem you're having?
Aliases are useful for example to support GitHub’s names, and map them to highlightjs names.
The solution you'd prefer / feature you'd like to see added...
Such as like so: https://github.com/wooorm/lowlight#lowregisteraliasname-alias, but anything that allows mapping a new label to an (existing) language name.
Any alternative solutions you considered...
There is no access to
languages
oraliases
, so it’s not possible to do this in userland.Additional context...
n/a
The text was updated successfully, but these errors were encountered: