Add support for serializing newforms to HTML
Currently, newforms only serializes to suit W3C's often-criticized Guidelines for serving XHTML 1.0 as text/html to buggy user agents. Its markup is not conformant with the HTML 4.01 specification, because according to HTML's SGML definition <input /> means <input>> not <input>. My patch leaves the status quo as the default, but facilitates producing conformant HTML by adding an optional argument to the serialization methods. as_p(forms.SERIALIZATION_HTML401) for example. If there's a better way to achieve the same thing, that would be good too. It would also be nice to be able to set SERIALIZATION_DEFAULT app-wide, but I'm not sure how that's done. It may be that an end_empty_element() function would be useful elsewhere in Django too.
Change History (7)
Core framework →
Design decision needed
|Patch needs improvement: