8000 Fix test-suite bug, fix real bug with head pointer pop, move another … · Nimbleworks/html5lib-php@73a05b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73a05b9

Browse files
author
Edward Z. Yang ext:(%22)
committed
Fix test-suite bug, fix real bug with head pointer pop, move another test to 99.
1 parent 4e149f1 commit 73a05b9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/HTML5/TreeConstructer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ public function emitToken($token, $mode = null) {
674674
* stack of open elements. */
675675
$this->stack[] = $this->head_pointer;
676676
$this->processWithRulesFor($token, self::IN_HEAD);
677-
array_pop($this->stack);
677+
array_splice($this->stack, array_search($this->head_pointer, $this->stack, true), 1);
678678

679679
// inversion of specification
680680
} elseif(

tests/HTML5/TestData.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ public static function strDom($node, $prefix = '| ') {
9191
if ($next->doctype) {
9292
$subnode = '<!DOCTYPE ';
9393
$subnode .= $next->doctype->name;
94-
if ($next->doctype->publicId) {
94+
if ($next->doctype->publicId || $next->doctype->systemId) {
9595
$subnode .= ' "' . $next->doctype->publicId . '"';
96-
}
97-
if ($next->doctype->systemId) {
9896
$subnode .= ' "' . $next->doctype->systemId . '"';
9997
}
10098
$subnode .= '>';

0 commit comments

Comments
 (0)
0