non boolean attributes
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start in src/HTML5/Serializer/OutputRules.php around line 371 and trace how disable_html_ns affects non-Boolean attributes. Check the configuration path for adding the proposed namespace-test bypass. Done means the option is backward-compatible and allows listed non-Boolean attributes to serialize with an empty value when namespace handling is disabled.
Written by the indexing model from the issue text.
Description
disable_html_ns was added to handle non-namespace aware tools. A common example in many usages of this lib:
XPath expressions will always fail because, e.g.
xmlns:p!=p
The problem with this config option:
Rules are defined for non-Boolean attributes to be output with ="" but these do not kick in when the disable_html_ns option is set.
What does the spec say?
Earlier versions of the HTML5 spec permitted the empty attribute syntax only for Boolean attributes. Later versions still don’t explicitly state that it is allowed for non-Boolean attributes, but they no longer say it is not (the specific clause, “This syntax is permitted only for boolean attributes,” has been removed).
validator.nu shows both <input disabled> and <input disabled=""> are valid (without namespace declarations).
Suggested changes
-
A config option to bypass the namespace tests and return return for anything listed in the
OutputRules::nonBooleanAttributes -
Based on the spec, the list if back to front. It should be listing attributes known as Boolean, rather than the other way round. Any unknown attribute should be classified as non-Boolean.
Item 1 above should be very simple to add and fully BC. Would you accept a PR for that?
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Masterminds/html5-php
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Masterminds/html5-php#280 ·
-
Template contents participate in the DOM treePossibly taken @eyupcanakman claimed this 204 days ago. Openhelp-wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Masterminds/html5-php#252 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Masterminds/html5-php#251 ·
-
Parser remove the single < (less than) character from given html stringPossibly taken @bsweeney claimed this 789 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Masterminds/html5-php#250 · 5 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
Masterminds/html5-php#246 · 1 comment ·
All issues in Masterminds/html5-php
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
code4romania/cpc#47 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
`document.cookie` with `max-age=0` does not delete the cookiePossibly taken @BartInTheField claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
capricorn86/happy-dom#2460 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
mdx-editor/editor#990 ·
Maintainers usually reply within 1 day