@@ -1294,19 +1294,31 @@ public function testFixBrokenMacrosWithCustomMacro(): void
1294
1294
self ::assertEquals ('<w:r><w:t>{{documentContent}}</w:t></w:r> ' , $ fixed );
1295
1295
1296
1296
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>{</w:t><w:t>{documentContent}}</w:t></w:r> ' );
1297
- self ::assertEquals ('<w:r><w:t>{{documentContent}}</w:t></w:r> ' , $ fixed );
1297
+ self ::assertEquals ('<w:r><w:t>{{documentContent}}</w:t><w:t xml:space="preserve"></w:t></w:r> ' , $ fixed );
1298
+
1299
+ $ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>{</w:t><w:t>{documentContent}}</w:t></w:r> ' );
1300
+ self ::assertEquals ('<w:r><w:t>{{documentContent}}</w:t><w:t xml:space="preserve"></w:t></w:r> ' , $ fixed );
1298
1301
1299
1302
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>$1500</w:t><w:t>{{documentContent}}</w:t></w:r> ' );
1300
1303
self ::assertEquals ('<w:r><w:t>$1500</w:t><w:t>{{documentContent}}</w:t></w:r> ' , $ fixed );
1301
1304
1302
1305
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>$1500</w:t><w:t>{</w:t><w:t>{documentContent}}</w:t></w:r> ' );
1303
- self ::assertEquals ('<w:r><w:t>$1500</w:t><w:t>{{documentContent}}</w:t></w:r> ' , $ fixed );
1306
+ self ::assertEquals ('<w:r><w:t>$1500</w:t><w:t>{{documentContent}}</w:t><w:t xml:space="preserve"></w:t>< /w:r> ' , $ fixed );
1304
1307
1305
1308
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>25$ plus some info {hint}</w:t></w:r> ' );
1306
1309
self ::assertEquals ('<w:r><w:t>25$ plus some info {hint}</w:t></w:r> ' , $ fixed );
1307
1310
1308
1311
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:t>$</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/><w:r><w:t xml:space="preserve">15,000.00. </w:t></w:r><w:r w:rsidR="0056499B"><w:t>{</w:t></w:r><w:r w:rsidR="00573DFD" w:rsidRPr="00573DFD"><w:rPr><w:iCs/></w:rPr><w:t>{</w:t></w:r><w:proofErr w:type="spellStart"/><w:r w:rsidR="00573DFD" w:rsidRPr="00573DFD"><w:rPr><w:iCs/></w:rPr><w:t>variable_name</w:t></w:r><w:proofErr w:type="spellEnd"/><w:r w:rsidR="00573DFD" w:rsidRPr="00573DFD"><w:rPr><w:iCs/></w:rPr><w:t>}}</w:t></w:r> ' );
1309
- self ::assertEquals ('<w:t>$</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/><w:r><w:t xml:space="preserve">15,000.00. </w:t></w:r><w:r w:rsidR="0056499B"><w:t>{{variable_name}}</w:t></w:r> ' , $ fixed );
1312
+ self ::assertEquals ('<w:t>$</w:t></w:r><w:bookmarkStart w:id="0" w:name="_GoBack"/><w:bookmarkEnd w:id="0"/><w:r><w:t xml:space="preserve">15,000.00. </w:t></w:r><w:r w:rsidR="0056499B"><w:t>{{variable_name}}</w:t></w:r><w:r w:rsidR="00573DFD" w:rsidRPr="00573DFD"><w:rPr><w:iCs/></w:rPr><w:t xml:space="preserve"></w:t></w:r><w:proofErr w:type="spellStart"/><w:r w:rsidR="00573DFD" w:rsidRPr="00573DFD"><w:rPr><w:iCs/></w:rPr><w:t xml:space="preserve"></w:t></w:r><w:proofErr w:type="spellEnd"/><w:r w:rsidR="00573DFD" w:rsidRPr="00573DFD"><w:rPr><w:iCs/></w:rPr><w:t xml:space="preserve"></w:t></w:r> ' , $ fixed );
1313
+
1314
+ $ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>before {{</w:t></w:r><w:r><w:t xml:space="preserve">variable}} </w:t></w:r><w:r><w:t>after</w:t></w:r> ' );
1315
+ self ::assertEquals ('<w:r><w:t>before {{variable}}</w:t></w:r><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>after</w:t></w:r> ' , $ fixed );
1316
+
1317
+ $ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>before {{</w:t></w:r><w:r><w:t>variable</w:t></w:r><w:r><w:t xml:space="preserve">}} </w:t></w:r><w:r><w:t>after</w:t></w:r> ' );
1318
+ self ::assertEquals ('<w:r><w:t>before {{variable}}</w:t></w:r><w:r><w:t xml:space="preserve"></w:t></w:r><w:r><w:t xml:space="preserve"> </w:t></w:r><w:r><w:t>after</w:t></w:r> ' , $ fixed );
1319
+
1320
+ $ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>{{</w:t></w:r><w:r><w:t>variable1</w:t></w:r><w:r><w:t>}} {{</w:t></w:r><w:r><w:t>variable2</w:t></w:r><w:r><w:t>}}</w:t></w:r> ' );
1321
+ self ::assertEquals ('<w:r><w:t>{{variable1}}</w:t></w:r><w:r><w:t xml:space="preserve"></w:t></w:r><w:r><w:t xml:space="preserve"> {{variable2}}</w:t></w:r><w:r><w:t xml:space="preserve"></w:t></w:r><w:r><w:t xml:space="preserve"></w:t></w:r> ' , $ fixed );
1310
1322
}
1311
1323
1312
1324
/**
0 commit comments