From 23e0d830c030731313755e5c1129f9bd667475ef Mon Sep 17 00:00:00 2001 From: Murilo Date: Thu, 12 Apr 2018 11:16:10 -0300 Subject: [PATCH] Fix TemplateProcessor :: fixBrokenMacros; The current regex causes the loss of the original formatting of some documents after the variables have been overwritten. Replaces the current regex with one that resolves this problem. --- src/PhpWord/TemplateProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 72446ae744..9a4d86238c 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -444,7 +444,7 @@ protected function fixBrokenMacros($documentPart) $fixedDocumentPart = $documentPart; $fixedDocumentPart = preg_replace_callback( - '|\$[^{]*\{[^}]*\}|U', + '|\$(?:<[^{]*)?\{[^}]*\}|U', function ($match) { return strip_tags($match[0]); },