File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
tests/Flow/ETL/Tests/Unit/Row/Entry
lib/types/src/Flow/Types/Type/Logical Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public function __construct(
3232 ?Metadata $ metadata = null ,
3333 ) {
3434 if (\is_string ($ value )) {
35- $ this ->value = HTMLDocument::createFromString ($ value );
35+ $ this ->value = HTMLDocument::createFromString ($ value, \ LIBXML_NOERROR );
3636 } else {
3737 $ this ->value = $ value ;
3838 }
Original file line number Diff line number Diff line change @@ -166,6 +166,24 @@ public function test_renames_entry() : void
166166 self ::assertEquals ($ entry ->type (), $ newEntry ->type ());
167167 }
168168
169+ public function test_with_non_fully_valid_html_string () : void
170+ {
171+ $ html = <<<'HTML'
172+ <!DOCTYPE html>
173+ <html lang="en">
174+ <head></head>
175+ <body>
176+ <div>foo</div>
177+ <div><p><span>bar</span></span></p></div>
178+ </body>
179+ </html>
180+ HTML;
181+ $ entry = html_entry ('html ' , $ html );
182+
183+ // Not equals as HTMLDocument removed unexpected close of span tag
184+ self ::assertNotEquals ($ html , $ entry ->toString ());
185+ }
186+
169187 public function test_with_value () : void
170188 {
171189 $ entry = html_entry ('html ' , '<!DOCTYPE html><html lang="en"><head></head><body><div>foobar</div></body></html> ' );
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public function cast(mixed $value) : HTMLDocument
4040
4141 /* @phpstan-ignore-next-line */
4242 if (\is_string ($ value )) {
43- return HTMLDocument::createFromString ($ value );
43+ return HTMLDocument::createFromString ($ value, \ LIBXML_NOERROR );
4444 }
4545
4646 return $ value ;
You can’t perform that action at this time.
0 commit comments