Steps to reproduce
- Take any form generated through rails containing hidden inputs (e.g. the
_method or token inputs)
- Copy the HTML source of that page
- Paste this to: https://validator.w3.org/nu/#textarea
- See invalid HTML

Expected behavior
We would expect the HTML produced by the Rails form helpers to be valid HTML.
Actual behavior
The HTML produced by Rails form helpers is not valid.
System configuration
Rails version: Latest (main branch)
Ruby version: Any compatible version (for the relevant project we are using 3.1.1 if it matters)
Additional context
This functionality originates from #43280 (related issue #42610).
Related discussion:
https://discuss.rubyonrails.org/t/form-with-first-field-value-is-overriden-with-a-token-like-string/74861/4
Related Firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=520561
Steps to reproduce
_methodortokeninputs)Expected behavior
We would expect the HTML produced by the Rails form helpers to be valid HTML.
Actual behavior
The HTML produced by Rails form helpers is not valid.
System configuration
Rails version: Latest (
mainbranch)Ruby version: Any compatible version (for the relevant project we are using 3.1.1 if it matters)
Additional context
This functionality originates from #43280 (related issue #42610).
Related discussion:
https://discuss.rubyonrails.org/t/form-with-first-field-value-is-overriden-with-a-token-like-string/74861/4
Related Firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=520561