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()
329
329
} catch (AttributeNotFoundException $ e ) {
330
330
// attribute that was in the array not found in the array... let's continue.
331
331
continue ;
332
+ } catch (\TypeError $ e ) {
333
+ $ val = null ;
332
334
}
333
335
$ val = $ attributeDTO ->getValue ();
334
336
if (\is_null ($ val )) {
Original file line number Diff line number Diff line change 4
4
5
5
use PHPHtmlParser \Dom ;
6
6
use PHPHtmlParser \Dom \Node \TextNode ;
7
+ use PHPHtmlParser \Options ;
7
8
use PHPUnit \Framework \TestCase ;
8
9
use stringEncode \Encode ;
9
10
@@ -74,4 +75,14 @@ public function testSetTextEncoded()
74
75
$ node ->setText ('biz baz ' );
75
76
$ this ->assertEquals ('biz baz ' , $ node ->text ());
76
77
}
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
+ }
77
88
}
You can’t perform that action at this time.
0 commit comments