Fix bug where one is using '%' (modulo operator) inside a tag
This commit is contained in:
parent
84062c0c28
commit
c35a4ed676
@ -1,3 +1,7 @@
|
||||
0.3.5 (2017-02-20)
|
||||
------------------
|
||||
- Fix bug where one is using '%' (modulo operator) inside a tag
|
||||
|
||||
0.3.4 (2017-02-14)
|
||||
------------------
|
||||
- Add Listing class to manage \n and \a (new paragraph) and escape text AND keep current styling
|
||||
|
||||
@ -5,7 +5,7 @@ Created : 2015-03-12
|
||||
@author: Eric Lapouyade
|
||||
'''
|
||||
|
||||
__version__ = '0.3.4'
|
||||
__version__ = '0.3.5'
|
||||
|
||||
from lxml import etree
|
||||
from docx import Document
|
||||
@ -72,7 +72,7 @@ class DocxTemplate(object):
|
||||
|
||||
def clean_tags(m):
|
||||
return m.group(0).replace(r"‘","'").replace('<','<').replace('>','>')
|
||||
src_xml = re.sub(r'(?<=\{[\{%])([^\}%]*)(?=[\}%]})',clean_tags,src_xml)
|
||||
src_xml = re.sub(r'(?<=\{[\{%])(.*?)(?=[\}%]})',clean_tags,src_xml)
|
||||
|
||||
return src_xml
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user