File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,21 @@ public function testParseFullHtml()
86
86
$ this ->assertCount (2 , $ section ->getElements ());
87
87
}
88
88
89
+ /**
90
+ * Test HTML entities
91
+ */
92
+ public function testParseHtmlEntities ()
93
+ {
94
+ \PhpOffice \PhpWord \Settings::setOutputEscapingEnabled (true );
95
+ $ phpWord = new \PhpOffice \PhpWord \PhpWord ();
96
+ $ section = $ phpWord ->addSection ();
97
+ Html::addHtml ($ section , 'text with entities <my text> ' );
98
+
99
+ $ doc = TestHelperDOCX::getDocument ($ phpWord , 'Word2007 ' );
100
+ $ this ->assertTrue ($ doc ->elementExists ('/w:document/w:body/w:p[1]/w:r/w:t ' ));
101
+ $ this ->assertEquals ('text with entities <my text> ' , $ doc ->getElement ('/w:document/w:body/w:p[1]/w:r/w:t ' )->nodeValue );
102
+ }
103
+
89
104
/**
90
105
* Test underline
91
106
*/
You can’t perform that action at this time.
0 commit comments