christopher-ramirez/secretary

Text style tags not always properly stripped from template elements

DieterBuysAI opened this issue · 4 comments

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.

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.

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?

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

Pleased to be of service @christopher-ramirez