From c15ece28c1558700568768b18206e8f8b7a22f22 Mon Sep 17 00:00:00 2001 From: elapouya Date: Wed, 21 Nov 2018 09:41:44 +0100 Subject: [PATCH] Smart double quotes in jinja tags are now converted into simple double quotes --- CHANGES.rst | 4 ++++ docxtpl/__init__.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 24c8fcc..1c57d24 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,7 @@ +0.5.11 (2018-11-21) +------------------- +- Smart double quotes in jinja tags are now converted into simple double quotes + 0.5.10 (2018-11-20) ------------------- - Smart quotes in jinja tags are now converted into simple quotes diff --git a/docxtpl/__init__.py b/docxtpl/__init__.py index d17cd7a..42b8183 100644 --- a/docxtpl/__init__.py +++ b/docxtpl/__init__.py @@ -5,7 +5,7 @@ Created : 2015-03-12 @author: Eric Lapouyade ''' -__version__ = '0.5.10' +__version__ = '0.5.11' from lxml import etree from docx import Document @@ -188,6 +188,8 @@ class DocxTemplate(object): .replace(r"‘","'") .replace('<','<') .replace('>','>') + .replace(u'“',u'"') + .replace(u'”',u'"') .replace(u"‘",u"'") .replace(u"’",u"'") ) src_xml = re.sub(r'(?<=\{[\{%])(.*?)(?=[\}%]})',clean_tags,src_xml)