Merge pull request #142 from nickgashkov/fix/vmerge-w-t-attributes

Fix vertical merge tag for table cells with XML attributes
This commit is contained in:
Eric Lapouyade 2018-09-12 17:14:31 +02:00 committed by GitHub
commit 0c02520b6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ class DocxTemplate(object):
m1.group(4) # ``</w:t>``. m1.group(4) # ``</w:t>``.
) )
return re.sub( return re.sub(
r'(</w:tcPr>.*?<w:t>)(.*?)(?:{%\s*vm\s*%})(.*?)(</w:t>)', r'(</w:tcPr[ >].*?<w:t(?:.*?)>)(.*?)(?:{%\s*vm\s*%})(.*?)(</w:t>)',
vMerge, vMerge,
m.group(), # Everything between ``</w:tc>`` and ``</w:tc>`` with ``{% vm %}`` inside. m.group(), # Everything between ``</w:tc>`` and ``</w:tc>`` with ``{% vm %}`` inside.
flags=re.DOTALL, flags=re.DOTALL,