8000 Hack up a fix for the very last failing test. · Nimbleworks/html5lib-php@c687b67 · GitHub
[go: up one dir, main page]

Skip to content

Commit c687b67

Browse files
author
Edward Z. Yang ext:(%22)
committed
Hack up a fix for the very last failing test.
1 parent bc44656 commit c687b67

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

library/HTML5/TreeConstructer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ public function emitToken($token, $mode = null) {
199199
$this->dom->appendChild($doctype);
200200
} else {
201201
// It looks like libxml's not actually *able* to express this case.
202-
// So... don't. XXX
202+
// So... don't.
203+
$this->dom->emptyDoctype = true;
203204
}
204205
$public = is_null($token['public']) ? false : strtolower($token['public']);
205206
$system = is_null($token['system']) ? false : strtolower($token['system']);

tests/HTML5/TestData.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public static function strDom($node, $prefix = '| ') {
9797
}
9898
$subnode .= '>';
9999
$subnodes[] = $subnode;
100+
} elseif (!empty($next->emptyDoctype)) {
101+
$subnodes = array('<!DOCTYPE >');
100102
}
101103
break;
102104
case XML_TEXT_NODE:

0 commit comments

Comments
 (0)
0