mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
tests: Fix failures due to CDATA handling in PHP
It appears PHP's DOM library always uses CDATA nodes for the contents of <style> tags, even if there is no such markup in the source HTML. Change-Id: Id04b27086c5e7a0b016a3a440b2b4895d6b13c93
This commit is contained in:
parent
33d69e26c9
commit
76289cdf73
|
@ -199,6 +199,7 @@ class DiscussionToolsCommentParser {
|
|||
if (
|
||||
$n && (
|
||||
( $n->nodeType === XML_TEXT_NODE && $this->htmlTrim( $n->nodeValue ) !== '' ) ||
|
||||
( $n->nodeType === XML_CDATA_SECTION_NODE && $this->htmlTrim( $n->nodeValue ) !== '' ) ||
|
||||
( $n->nodeType === XML_ELEMENT_NODE && !$n->firstChild )
|
||||
)
|
||||
) {
|
||||
|
|
|
@ -634,6 +634,7 @@ function nextInterestingLeafNode( node, rootNode ) {
|
|||
}
|
||||
if (
|
||||
( n.nodeType === Node.TEXT_NODE && htmlTrim( n.textContent ) !== '' ) ||
|
||||
( n.nodeType === Node.CDATA_SECTION_NODE && htmlTrim( n.textContent ) !== '' ) ||
|
||||
( n.nodeType === Node.ELEMENT_NODE && !n.firstChild )
|
||||
) {
|
||||
return NodeFilter.FILTER_ACCEPT;
|
||||
|
|
Loading…
Reference in a new issue