GithubHelp home page GithubHelp logo

Tag Helper Rewriting is brittle about razor HOT 4 OPEN

333fred avatar 333fred commented on July 21, 2024 1
Tag Helper Rewriting is brittle

from razor.

Comments (4)

jjonescz avatar jjonescz commented on July 21, 2024

I do not think the first two examples are broken. The current parsing makes sense to me - if you do not use explicit C# transition @(...), we parse as HTML, i.e., if the attribute value starts with quote ', you cannot use that inside. We should spec it like that.

from razor.

jaredpar avatar jaredpar commented on July 21, 2024

. We should spec it like that.

Generally agree. Essentially within a tag helper and you want C# behavior then use the @(...) transition to be explicit. Otherwise your results may vary due to the issues outlined in the text.

from razor.

jjonescz avatar jjonescz commented on July 21, 2024

Note that .razor component parsing behaves equivalently - e.g., given a Component1 with [Parameter] public object Param { get; set; }, then:

<Component1 Param='"'/> am I a string value?"' />

is parsed as Component1 with Param = '"' plus HTML markup am I a string value?"' /> outside of the component. (And it is a compile time error because " is not a valid C# object value.)

from razor.

emperador-ming avatar emperador-ming commented on July 21, 2024

As a user, I would like these cases not to compile or, at the very least, raise a warning recommending an explicit @(...) transition.

Thanks so much for the good work, guys.

from razor.

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.