You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because Unquoted text is important feature in HTML/XML context, we can try to reuse proc_macro2::Span::join.
Proposal:
Implement temporary workaround that will use proc_macro2 fallback implementation directly.
Parse two times:
One with regular TokenStream, and with correct unjoined Span.
And second time with fallback::TokenStream created from Span::call_site().source_text().
Both parse phases should return same Node tree, but with different Spans.
Use second Node tree to recover source_text of RawText.
Cons:
Parse two time
The text was updated successfully, but these errors were encountered:
for the cons, maybe there could be a feature flag you could add to enable re-parsing? this would be useful for people who don't care about having <style>/<script> support.
Currently
RawText
uses unstableSpan::join
https://github.com/rs-tml/rstml/blob/v0.10.1/src/node/raw_text.rs#L52to provide source text with spaces. Because of its unstability it is not availabe on stable rust.
I found that in test https://github.com/rs-tml/rstml/blob/v0.10.1/tests/test.rs#L110 unquoted text is working even on stable, because fallback implementation of
proc_macro2::TokenStream
can handleSpan::join
.Because Unquoted text is important feature in HTML/XML context, we can try to reuse
proc_macro2::Span::join
.Proposal:
Implement temporary workaround that will use
proc_macro2
fallback implementation directly.Parse two times:
One with regular
TokenStream
, and with correct unjoinedSpan
.And second time with
fallback::TokenStream
created fromSpan::call_site().source_text()
.Both parse phases should return same Node tree, but with different Spans.
Use second Node tree to recover source_text of RawText.
Cons:
The text was updated successfully, but these errors were encountered: