Bug: parsing negative attributes in tag definition
See original GitHub issueThe code:
el("input[type=number][min=-1]");
Generates:
<input type="number"></input>
Instead of:
<input type="number" min="-1"></input>
Example: https://domvm.github.io/domvm/demos/playground/#mobx
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
HTML 5.2: 8. The HTML syntax - W3C
This specification defines the parsing rules for HTML documents, whether they are syntactically correct or not. Certain points in the parsing ...
Read more >4.1.1 Parsing - Duplicate attributes with no user impact cause ...
e) when the duplicated attributes specify have different values with exactly the same meaning - because the browser stores exactly one value ...
Read more >HTML Standard
2.3.1 Common parser idioms; 2.3.2 Boolean attributes; 2.3.3 Keywords and enumerated attributes; 2.3.4 Numbers. 2.3.4.1 Signed integers; 2.3.4.2 Non-negative ...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >XTF » Tag Reference - California Digital Library
Stylesheet parameters; Parser Input Tags; Error Generator Stylesheet · Utilities ... This section summarizes the attributes defined for the Pre-Filter ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The advantage with the simpler regexp is that it doesn’t skip attributes that contain unsupported characters. It took me a few days to notice that the
[min=-1]
was not rendered, because I forgot that I wrote it. It is always better to not ignore errors.I would also accept a
=
without a value. After all, HTML accepts empty attributes, so it is less surprising to accept it too.If you accept:
el("div", {"at tr": "val"})
, I think you can also acceptel("div[at tr=val]")
. At least this way it has a chance to trigger an error on the client instead of being completely ignored.Which would give us:
Looks good.