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

Removes datalist's option tags when use LEGACY HTML5 template mode and nekohtml 1.9.13+ #338

Closed
KORPSE opened this issue Jan 10, 2015 · 1 comment

Comments

@KORPSE
Copy link

KORPSE commented Jan 10, 2015

For example view:

<!DOCTYPE html>
<html>
    <head>
        <title>Hello</title>
    </head>
    <body>
        <input list="datalist" name="select">
        <datalist id="datalist">
            <option>1</option>
            <option>2</option>
        </datalist>
    </body>
</html>

renders to something like that when using nekohtml 1.9.12:

<!DOCTYPE html>

<html>
    <head>
        <title>Hello</title>
    </head>
    <body>
        <input list="datalist" name="select" />
        <datalist id="datalist">
            <SELECT><option>1</option>
            <option>2</option>
        </SELECT></datalist>

</body></html>

Despite of unwanted this works correct. And when using nekohtml 1.9.13+: <!DOCTYPE html> <html> <head> <title>Hello</title> </head> <body> <input list="datalist" name="select"> <datalist id="datalist"> 1 2 </datalist> </body> </html> Looking to change log of version 1.9.13 (http://nekohtml.sourceforge.net/changes.html) I saw this: don't generate opening TABLE or SELECT tag when it's missing (therefore discard child nodes) I don't know is this issue treat more to Thymeleaf or to nekohtml, so i put it here. Sory if it is wrong. Thanks for your attention.

@danielfernandez
Copy link
Member

I'm afraid it looks as if nekohtml is taking the wrong decisions there, trying to force code to be more HTML4-compliant (but not HTML5 :(). The fact that <select> does not exist of course should not influence at all the existence of <option>s...

You will have to use the HTML5 template mode there to avoid nekohtml. As a side comment, Thymeleaf 3.0 will not need nekohtml anymore to process non-XML-ized HTML5 markup, so things like these should never happen again...

@danielfernandez danielfernandez self-assigned this Jan 15, 2015
@danielfernandez danielfernandez removed this from the Thymeleaf 2.1 milestone May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants