Giter Site home page Giter Site logo

Comments (6)

rmccue avatar rmccue commented on May 29, 2024

I clarified this one on Twitter:

That's is the right bit of the spec for this: it's present, therefore it's true. The following sentence is essentially an authoring conformance requirement, and doesn't in any way override this.

Therefore, we should set the value to true if it's set at all.

from interweave.

milesj avatar milesj commented on May 29, 2024

@rmccue I disagree. That may be what the spec says, but I'd wager many developers have passed ="false" or something similar in their HTML. We should probably just remove them if that happens.

from interweave.

rmccue avatar rmccue commented on May 29, 2024

Developers may do that, but it won't work, as browser behaviour matches the spec: https://codepen.io/anon/pen/GPgQNK

Firefox, Chrome, and Safari all treat the presence of a boolean attribute as truthy, even if the value is empty string, "false", "0", etc. Interweave should match this behaviour so that it can match dangerouslySetInnerHTML's behaviour.

from interweave.

milesj avatar milesj commented on May 29, 2024

Hrmmm, not sure I fully agree with the change though. This would definitely be a breaking change, so I'd wait till my TS PR is done before handling this.

from interweave.

rmccue avatar rmccue commented on May 29, 2024

In the meantime, would you consider merging a change to allow at least empty string to be treated as true? This is breaking our parsing right now.

from interweave.

milesj avatar milesj commented on May 29, 2024

@rmccue Yeah that'll be fine.

from interweave.

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.