Skip to content
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

private __emitTokens API #3620

Merged
merged 6 commits into from Mar 19, 2023
Merged

Conversation

joshgoebel
Copy link
Member

@joshgoebel joshgoebel commented Sep 13, 2022

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 Emitter API
  • A grammar may supply a __emitTokens(code, emitter) function as part of the language data it returns when called

Checklist

  • Add unit tests for __emitTokens
  • Updated the changelog at CHANGES.md

@joshgoebel
Copy link
Member Author

joshgoebel commented Sep 13, 2022

@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.

@joshgoebel
Copy link
Member Author

@allejo When you have a moment.

@joshgoebel joshgoebel merged commit 11bce6a into highlightjs:main Mar 19, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature help welcome Could use help from community parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant