Open dbrgn opened 2 years ago
cargo -V
?
I'm trying to see if you're on stable or nightly.
Right now text works slightly differently on stable vs. nightly.
One approach would be to add a nightly
feature flag to html-macro
that controls whether or not unquoted text is supported. So that people can't accidentally use unquoted text on stable.
Aah, that explains it! I previously used nightly, but migrated to stable recently. The tests pass on nightly (except for one test that does assertions with regards to error message output.)
One approach would be to add a
nightly
feature flag tohtml-macro
that controls whether or not unquoted text is supported. So that people can't accidentally use unquoted text on stable.
That would be nice. Or a unquoted-text
feature that throws a compile-time error if used on a non-nightly Rust version.
The quoting workaround is a bit awkward due to double curly braces when using top-level text:
html! { { "Hello World" } },
However, I guess we'll have to live with this limitation for now.
There shouldn't be a fundamental reason that we couldn't support html!{ "Hello World" }
, would probably just require some tweaks to the parsing logic.
I'm also realizing that we shouldn't need a feature flag.
If you aren't on nightly then Span.line()
and Span.column()
always return 0, so whenever we encounter unquoted text we can just check the line/column
and if they are both zero we create a compile time error that unquoted text only works on nightly.
I upgraded to html-macro 0.7.1, but my project testsuite started failing due to the way spaces are handled.
So as a sanity-check, I ran the tests in percy itself:
It seems like a lot of tests are failing. This happens on commit 2aed65476bc4d4660c0eb2fe6c733ce96bf6aee7 (0.7.0) as well.