highlight.js
highlight.js copied to clipboard
private __emitTokens API
Needed for #3619. Plan is to release this with 10.7.
Changes
- Allows grammars to provide their own parsers that output to the private HLJS
EmitterAPI - A grammar may supply a
__emitTokens(code, emitter)function as part of the language data it returns when called
Checklist
- [x] Add unit tests for
__emitTokens - [x] Updated the changelog at
CHANGES.md
@wooorm Relevant to you because once this goes public the Emitter API will become part of our public API since custom grammars will need to trust this API to be stable. No rush, but it'll happen eventually I think. I'd love to see what people could do with this.
@allejo When you have a moment.