Giter VIP home page Giter VIP logo

Comments (4)

dbrgn avatar dbrgn commented on May 29, 2024 1

https://github.com/chinedufn/percy/blob/2aed65476bc4d4660c0eb2fe6c733ce96bf6aee7/README.md#stable-rust

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 to html-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.

from percy.

chinedufn avatar chinedufn commented on May 29, 2024

cargo -V?
I'm trying to see if you're on stable or nightly.

Right now text works slightly differently on stable vs. nightly.

https://github.com/chinedufn/percy/blob/2aed65476bc4d4660c0eb2fe6c733ce96bf6aee7/README.md#stable-rust

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.

from percy.

dbrgn avatar dbrgn commented on May 29, 2024

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.

from percy.

chinedufn avatar chinedufn commented on May 29, 2024

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.

from percy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.