christopher-ramirez / secretary

Take the power of Jinja2 templates to OpenOffice and LibreOffice.
Other
190 stars 48 forks source link

Text style tags not always properly stripped from template elements #16

Closed DieterBuysAI closed 9 years ago

DieterBuysAI commented 9 years ago

In particular, secretary has difficulty parsing statements such as {% if [1, 2, 3]|length > 0 %}Foo Bar{% endif %} because OpenOffice likes to insert text styling tags around the square brackets. Small tweak to the _unescape_entities method can fix this.

christopher-ramirez commented 9 years ago

What specifically styling tags is OpenOffice inserting around square brackets? I could not reproduce this issue on Libreoffice. The sample statement is stored as {% if [1, 2, 3]|length > 0 %}Foo Bar{% endif %} (just replacing greater-than symbol with > as expected.

DieterBuysAI commented 9 years ago

Actually I was using LibreOffice too. I don't have the template data handy now but whenever I wrote [ or ] then LibreOffice Writer would insert <text:span> tags around it. In general any styling tags inside the {% ... %} or {{ ... }} should be ignored, no?

christopher-ramirez commented 9 years ago

Thank for your contribution and help. I've uploaded a new version fixing issues #14 and #16.

DieterBuysAI commented 9 years ago

Pleased to be of service @christopher-ramirez