christopher-ramirez / secretary

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

HTML unescaping only replaces first ocurrance of HTML codes and does not handle & or " #14

Closed DieterBuysAI closed 9 years ago

DieterBuysAI commented 9 years ago

The helper method _unescape_entities(xml_text) does not handle HTML codes & or ". Unfortunately this precludes some useful template values such as {{ date.strftime("%Y-%m-%d") }}. In addition, any expression that involves more than one instance of escaped characters would also fail due to the regular expression substitution being performed only once.

christopher-ramirez commented 9 years ago

Thank for reporting this Dieter. I believe this issue is related to issue #16. So I will close the later and let's continue discussion over this one.

Indeed I've found issues on _unescape_entities function. Using PR #15 maybe we could implement a fix.