File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,8 @@ public function makeOpeningTag()
329329 } catch (AttributeNotFoundException $ e ) {
330330 // attribute that was in the array not found in the array... let's continue.
331331 continue ;
332+ } catch (\TypeError $ e ) {
333+ $ val = null ;
332334 }
333335 $ val = $ attributeDTO ->getValue ();
334336 if (\is_null ($ val )) {
Original file line number Diff line number Diff line change 44
55use PHPHtmlParser \Dom ;
66use PHPHtmlParser \Dom \Node \TextNode ;
7+ use PHPHtmlParser \Options ;
78use PHPUnit \Framework \TestCase ;
89use stringEncode \Encode ;
910
@@ -74,4 +75,14 @@ public function testSetTextEncoded()
7475 $ node ->setText ('biz baz ' );
7576 $ this ->assertEquals ('biz baz ' , $ node ->text ());
7677 }
78+
79+ public function testCommentWithNumbers () {
80+ $ dom = new Dom ;
81+ $ options = new Options ();
82+ $ options ->setCleanupInput (false );
83+ $ dom ->setOptions ($ options );
84+ $ dom ->loadStr ('<!-- test comment with number 2 --> ' );
85+ $ output = $ dom ->outerHtml ;
86+ $ this ->assertContains ('<!-- test comment with number 2 --> ' , $ output );
87+ }
7788}
You can’t perform that action at this time.
0 commit comments