questionpy-org / questionpy-sdk

Library and toolset for the development of QuestionPy packages
https://questionpy.org
MIT License
0 stars 2 forks source link

Export to HTML instead of XML to force full HTML compatibility #86

Closed tx0c3 closed 2 weeks ago

tx0c3 commented 1 month ago

Currently, empty tags will be turned into self-closing tags (<.../>). However, in HTML, this is only supported for some tags, see https://html.spec.whatwg.org/multipage/syntax.html#start-tags point 6 (void and foreign elements). In some cases this may lead to invalid HTML which doesn't meet expected behavior. This example:

<textarea placeholder="Some placeholder" name="somename" required=""></textarea>

will be read from the template, and in the end be rendered as

<textarea placeholder="Some placeholder" name="somename" required=""/>

as XML supports self-closing tags in general, and therefore all empty tags will be converted.

Note that the change in questionpy_sdk/webserver/question_ui.py:213 has not been tested.