-
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
ehn(api): add unregisterLanguage method #3009
Conversation
67aaf51
to
568c999
Compare
568c999
to
237c706
Compare
Curious: What is your use case for needing to unregister a language? It seem obvious yet we've gotten by without it since inception so I'm curious. |
This would also need to be documented in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this would be a core API method we'd also probably want at least one test to show that it indeed does what it's expected to do.
Useful for testing, in the test suite we have to remove the module from the cache to remove the test languages added by the other tests: highlight.js/test/detect/index.js Lines 3 to 4 in 742e87b
This could be avoided if the other tests were cleaning up their test languages. This is needed to move the test suite to ESM syntax (joshgoebel#1). |
Ah, that makes sense since we can't just delete the require cache anymore. :) |
@aduh95 Thanks! |
Changes
Currently, there is no way of un-do a
registerLanguage
operation except re-loading the whole library. Adds aunregisterLanguage
method to the public API.Checklist
CHANGES.md
AUTHORS.txt
, under Contributors