Doing so, i use nested [div id=“xxx”][/div] Tags. Some of these Tags do not have content in [Body] but getting the content from css-style in [head].
When printed, this arrangement gets condensed to [div id=“xxx”/] (only for these “empty” Tags like shown above) which subsequently leads to malformed PDF (most content not to be seen at all).
I am able to fix this issue placing short comment in the tag like [div id=“xxx”][!-- Comment --][/div].
Am i doing something wrong or may this be an code issue to be fixed?
Regards
Chris
For sure, i am using sharp brackets but that could not be handelt by the Forum.
Should not have filed the bug by email but opening an issue on git hub.
So prepared a working and a failing case.
While preparing templates, I come to the conclusion that it may not be caused by Weasyprint as both templates lead to the same (good) result (Executed on Windows Plattform).
Whereas the test from Tryton gives an erroneous result (Running on Linux Plattform).
Should have run both tests on my Tryton Server for a meaningful result.
Please find attached templates, test-skripts and resulting pdf files. Whoops. ZIP not allowed.
That’s why I’ve now run my examples on the Tryton server itself.
In the same python virtual environment as the tryton server process.
Printing my Template…
with [div][div/]-Tag directly with weasyprint → Works fine.
with [div/]-Tag directly with weasyprint → Leads to missing content in the generated file.
with [div][div/]-Tag as a regular Tryton Report → Leads to missing content in the generated file.
with [div][!-- Comment --][div/]-Tag as a regular Tryton Report → Works fine.
Some component illegally condenses the [div][div/]-Tag to a [div/]-Tag and it doesn’t appear to me to be weasyprint itself. I can verify this condensing in generated output when setting output-format temporarily from PDF to HTML in Tryton Report-Definition.
Weasyprint team’s response to my bug report as follows:
In HTML, the slash at the end of tags is just ignored. It means that “[div /]” is exactly like “[div]”, not “[div][/div]”.
Some tags are marked as void (img, input, br…) and don’t need a closing tag, that’s why you can write “[img]” (or “[img/]”) with no need to close it. As “[div]” is not one of them, you need a “[/div]” closing tag.