@@ -1253,19 +1253,28 @@ public function testFixBrokenMacros(): void
1253
1253
self ::assertEquals ('<w:r><w:t>${documentContent}</w:t></w:r> ' , $ fixed );
1254
1254
1255
1255
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>$</w:t><w:t>{documentContent}</w:t></w:r> ' );
1256
- self ::assertEquals ('<w:r><w:t>${documentContent}</w:t></w:r> ' , $ fixed );
1256
+ self ::assertEquals ('<w:r><w:t>${documentContent}</w:t><w:t xml:space="preserve"></w:t>< /w:r> ' , $ fixed );
1257
1257
1258
1258
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>$1500</w:t><w:t>${documentContent}</w:t></w:r> ' );
1259
1259
self ::assertEquals ('<w:r><w:t>$1500</w:t><w:t>${documentContent}</w:t></w:r> ' , $ fixed );
1260
1260
1261
1261
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>$1500</w:t><w:t>$</w:t><w:t>{documentContent}</w:t></w:r> ' );
1262
- self ::assertEquals ('<w:r><w:t>$1500</w:t><w:t>${documentContent}</w:t></w:r> ' , $ fixed );
1262
+ self ::assertEquals ('<w:r><w:t>$1500</w:t><w:t>${documentContent}</w:t><w:t xml:space="preserve"></w:t>< /w:r> ' , $ fixed );
1263
1263
1264
1264
$ fixed = $ templateProcessor ->fixBrokenMacros ('<w:r><w:t>25$ plus some info {hint}</w:t></w:r> ' );
1265
1265
self ::assertEquals ('<w:r><w:t>25$ plus some info {hint}</w:t></w:r> ' , $ fixed );
1266
1266
1267
1267
$ 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> ' );
1268
- 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 );
1268
+ 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 );
1269
+
1270
+ $ 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> ' );
1271
+ 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 );
1272
+
1273
+ $ 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> ' );
1274
+ 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 );
1275
+
1276
+ $ 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> ' );
1277
+ 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 );
1269
1278
}
1270
1279
1271
1280
/**
0 commit comments