This commit is contained in:
Eric Lapouyade 2022-07-14 15:06:21 +02:00
parent 7290528b3d
commit 5f21feb72d
3 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ Created : 2015-03-12
@author: Eric Lapouyade
"""
__version__ = '0.16.1'
__version__ = '0.16.2'
# flake8: noqa
from .inline_image import InlineImage

View File

@ -126,7 +126,7 @@ class DocxTemplate(object):
# {%- will merge with previous paragraph text
src_xml = re.sub(r'</w:t>(?:(?!</w:t>).)*?{%-', '{%', src_xml, flags=re.DOTALL)
# -%} will merge with next paragraph text
src_xml = re.sub(r'-%}(?:(?!<w:t[ >]).)*?<w:t[^>]*?>', '%}', src_xml, flags=re.DOTALL)
src_xml = re.sub(r'-%}(?:(?!<w:t[ >]|{%|{{).)*?<w:t[^>]*?>', '%}', src_xml, flags=re.DOTALL)
for y in ['tr', 'tc', 'p', 'r']:
# replace into xml code the row/paragraph/run containing