Add a new HTML rendering pipeline #2844
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This rewrites the HTML rendering pipeline to use a tree data structure, and implements a custom HTML serializer. The intent is to make it easier to make changes and to manipulate the output. This should make some future changes much easier.
This is a large change, but I'll try to briefly summarize what's changing:
tree.rs
.tokenizer.rs
.serialize.rs
.html_handlebars/search.rs
.print.rs
.<pre>
tags wrapping it.pretty_assertions
, they are no longer used (mostly being migrated to the testsuite).There's obviously a lot of risk trying to parse everything to such a low level, but I think the benefits are worth it. Also, the API isn't super ergonomic compared to say javascript (there are no selectors), but it works well enough so far.
I have not run this through rigorous benchmarking, but it does have a very noticeable performance improvement, especially in a debug build.
I expect in the future that we'll want to expose some kind of integration with extensions so they have access to this tree structure (or some kind of tree structure).
Closes #1736