Open obecker opened 3 years ago
That method is also inefficient given it renders the entire document and then does a string concatenation, duplicating the whole thing, instead of just writing to a StringBuilder, It could be updated to render to a shared StringBuilder and the unescaped text object doesn't even need to be created. But for version 2 I agree it should be its own type.
htmlTag.render(FlatHtml.inMemory(Config.global()).appendUnescapedText("<!DOCTYPE html>"), null);
There is this method in
TagCreator
:This returns a String by calling
render()
, thus it prevents using the new render possibilities introduced with https://github.com/tipsy/j2html/pull/179A better approach would be if there is a
Document
class that implementsRenderable
and that handles the correct rendering.Apparently this would break code written for j2html 1.*, so it is something we should consider for a 2.* release.