Comments (6)
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.
@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.
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.
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.
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.
@rmccue Yeah that'll be fine.
from interweave.
Related Issues (20)
- Youtube embed video with the iframe is not loading the video on the browser. HOT 4
- Interweave: Missing emoji source data. HOT 19
- Transform Docs Update Suggestions
- Cannot resolve interweave HOT 1
- import error HOT 1
- Certain HTML attributes such as tabindex is not supported HOT 2
- Version 13.1.0 is missing from the CHANGELOG.md
- React JSX Support HOT 2
- SSR Hydration issue when email (text) is present in html content
- SSR Hydration issue when email (text) is present in html content
- Html content are wrapping with span element as parent element HOT 4
- ID attribute is not working HOT 7
- colons in hash part break links HOT 1
- why interweave transform attributes to lowercase? HOT 5
- Add Tailwind classes in my html content HOT 1
- React error when transforming HOT 2
- 'Interweave' cannot be used as a JSX component. HOT 1
- Broken emoji PNG-s in emoji-picker
- Performance significantly drops for nested HTML HOT 2
- Interweave SSR breaks if style attribute malformed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interweave.