Open bleca opened 3 years ago
Edit : I figured why adding a space enable the list but I still don't figure why using this syntax merge the style with the previous character. Here is a repo to reproduce : https://github.com/bleca/repro-docxtpl-issue
The problem comes from that in your docx template, in the inner document.xml, the {%
and the -
are not in the same run : the regex cannot match.
I have to think for a solution...
I have same. Using {%-
at document beginning destroys Paper format information. We had after that len(doc.docx.sections) == 0
Describe the bug
To Reproduce
PYTHON minimal starting code from the doc
DOCX My house is located {%- if False -%} in urban area {%- else -%}
Expected behavior
The list disappear and style is merged with the style of the charatacter before. I found that adding an extra space after {%- else -%} makes it work.
I had the same problem playing with styles the style of first characters is removed and it's the style of the previous character which is applied (see capture) but I didn't find any explanation about why.
Screenshots
without the extra space
Additional context
Glad I found a workaround with the extra space but I'd like to better understand the reason.
Thanks for your work