Skip to content

Problems with template mode LEGACYHTML5 #23

@krat0s

Description

@krat0s

When changing the template mode from HTML5 to LEGACYHTML5 I keep getting the following exception:

[nz.net.ultraq.thymeleaf.decorator.DecoratorProcessor] layout:decorator attribute must appear in the root element of your content page

In my content page, the layout:decorator attribute does appear in the root element and the page is processed correctly as long as the template mode is set to HTML5. I have tried to debug the source code and it seems that

if (!(element.getParent() instanceof Document))

is always true as the parent is never the document but rather the enclosing element (in my case <body>).

The reason I need to use LEGACYHTML5 is that I need to use the th:utext attribute to include text which may contain HTML formatting, which is not necessarily XML-formed (i.e. it contains elements like <br> without a closing tag).

Is the layout dialect incompatible with the LEGACYHTML5 mode or am I missing something?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions