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

enh(parser) Refactor parse tree and HTML render into components #2404

Merged
merged 4 commits into from Feb 29, 2020

Conversation

joshgoebel
Copy link
Member

@joshgoebel joshgoebel commented Feb 16, 2020

This refactors the storage of the parse tree and the HTML rendering into their own components and separates them from the tokenizer itself.

Closes #1086

@joshgoebel joshgoebel added enhancement An enhancement or new feature parser labels Feb 16, 2020
@joshgoebel joshgoebel changed the title WIP: split out parse tree and HTML render enh(parser) Refactor parse tree and HTML render into components Feb 18, 2020
@allejo
Copy link
Member

allejo commented Feb 19, 2020

This looks a bit more of an invasive change, I can look this over in-depth later this week or weekend.

@joshgoebel
Copy link
Member Author

Anyone?

Copy link
Collaborator

@egor-rogov egor-rogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. See my comments.

src/lib/html_renderer.js Outdated Show resolved Hide resolved
src/lib/token_tree.js Outdated Show resolved Hide resolved
src/lib/token_tree.js Show resolved Hide resolved
src/lib/token_tree.js Outdated Show resolved Hide resolved
src/lib/token_tree.js Outdated Show resolved Hide resolved
src/lib/token_tree.js Outdated Show resolved Hide resolved
src/highlight.js Outdated Show resolved Hide resolved
@joshgoebel joshgoebel added this to the 10.0 milestone Feb 29, 2020
@joshgoebel
Copy link
Member Author

Please see the last commit, that's kind of the culmination of where I wanted to take this.

@joshgoebel joshgoebel force-pushed the parse_tree branch 2 times, most recently from 46d10dc to cef80f5 Compare February 29, 2020 22:03
- make emitter configurable
- mark this API as beta/private for now
- make rendering HTML a responsibility of the emitter
  (though it can of course delegate)

That wraps emitting/rendering up nicely into a single object.
@joshgoebel joshgoebel merged commit 1e14962 into highlightjs:master Feb 29, 2020
@joshgoebel joshgoebel mentioned this pull request Feb 29, 2020
15 tasks
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 parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide access to a parse tree as an alternative to HTML output
3 participants