Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] Removing self-closing slash from <input> #47715

Open
wants to merge 3 commits into
base: 6.3
Choose a base branch
from

Conversation

ThomasLandauer
Copy link
Contributor

Q A
Branch? 6.2
Bug fix? kinda
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR n/a

Switching form template from XHTML to HTML5 syntax.

https://validator.w3.org/nu/ says:

Warning: Self-closing tag syntax in text/html documents is widely discouraged; it’s unnecessary and interacts badly with other HTML features (e.g., unquoted attribute values). If you’re using a tool that injects self-closing tag syntax into all void elements, without any option to prevent it from doing so, then consider switching to a different tool.

I haven't searched for other occurrences; waiting for some feedback first.

https://validator.w3.org/nu/ says:

> Warning: Self-closing tag syntax in text/html documents is widely discouraged; it’s unnecessary and interacts badly with other HTML features (e.g., unquoted attribute values). If you’re using a tool that injects self-closing tag syntax into all void elements, without any option to prevent it from doing so, then consider switching to a different tool.

I haven't searched for other tags; waiting for some feedback first
@carsonbot carsonbot added this to the 6.2 milestone Sep 28, 2022
@ThomasLandauer ThomasLandauer changed the title Removing self-closing slash from <input> [Form] Removing self-closing slash from <input> Sep 28, 2022
ThomasLandauer added a commit to ThomasLandauer/symfony-docs that referenced this pull request Sep 29, 2022
I suggested the same for Symfony's templates, see symfony/symfony#47715
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Oct 5, 2022
…ThomasLandauer)

This PR was merged into the 6.2 branch.

Discussion
----------

[Security] Removing self-closing slash from `<input>`s

I suggested the same for Symfony's templates, see symfony/symfony#47715

Commits
-------

c08a0a8 Removing self-closing slash from `<input>`s
@maxbeckers
Copy link
Contributor

Hi @ThomasLandauer, did you see, there are failed a lot of related tests. And there is a space before the > what's not needed i guess.

@fabpot fabpot modified the milestones: 6.2, 6.3 Nov 1, 2022
@fabpot
Copy link
Member

fabpot commented Dec 9, 2022

@ThomasLandauer Do you have time to fix the tests?

@ThomasLandauer
Copy link
Contributor Author

I'm not sure. The tests are based on DOMDocument::loadXML(), which probably needs to be switched to ::loadHTML()?! But there's some stuff going on that I don't understand, e.g.:

// Wrap in <root> node so we can load HTML with multiple tags at
// the top level
$dom->loadXML('<root>'.$html.'</root>');

So if I should do it, I'd need somebody to take me by the hand...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants