Similar errors I get working with elements like <meta>, <link>, <script>, making it pretty annoying to clean up the existing code to incorporate into enonic XP views.
Are there any restrictions or any clear rules stating what should or should not be used or something to implicitly tell the parser we dont need to worry about closing tags (like probably use doctype implicitly?)
The Thymeleaf parser we’re using is sadly forcing this XML syntax on our markup.
To make it work - as you are saying - you must end all tags. Either self-close them or close them separately. Both these lines would work:
<hr/>
<hr></hr>
In the future we will fix this. They’re working on updating this so you can write 100% pure html5. But I’ll let a developer answer you on the ETA of that.
Imho using valid xml in your markup is a better solution than open-ended elements. I Even bet Google Will like your pages better if they support strict validation…
Coming from an XSLT background, I’ve always used XHTML. But there are times when it’s more convenient to just put an attribute with no =“something”.
I’m not that familiar with Thymeleaf backend. Is there a way to implement legacy without altering the XP code? Where is this templateResolver bean? Or do I just add ‘net.sourceforge.nekohtml:nekohtml:1.9.21’ to the build.gradle file? It would be nice if XP had a setting in a config file that could force legacy mode.
Ouch. My newbie apologies - and thanks for the immediate response. Would you know how (or if) I can set the mode to TemplateMode.HTML for my XP project?
This has not been exposed through the library at the moment.
We’re exposing an options parameter for this in the thymeleaf.render(view, model, options) function for 6.10 - hope this will make your day!