Skip to content

Commit 36e88a0

Browse files
authored
Use &Properties; entity in xpointer for inherited properties in class synopses (#7400)
This changes ClassInfo::createIncludeElement() such that it takes the $query argument as-is for the xpointer attribute value. Special characters, like " and &, are used as-is so be careful not to break the resulting XML.
1 parent e89048a commit 36e88a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build/gen_stub.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap): ?DOM
17851785
$parentClassName = self::getClassSynopsisFilename($parent);
17861786
$includeElement = $this->createIncludeElement(
17871787
$doc,
1788-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.$parentClassName')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='Properties']]))"
1788+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.$parentClassName')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='&Properties;']]))"
17891789
);
17901790
$classSynopsis->appendChild($includeElement);
17911791
}
@@ -1955,7 +1955,9 @@ private function hasMethods(): bool
19551955
private function createIncludeElement(DOMDocument $doc, string $query): DOMElement
19561956
{
19571957
$includeElement = $doc->createElement("xi:include");
1958-
$includeElement->setAttribute("xpointer", $query);
1958+
$attr = $doc->createAttribute("xpointer");
1959+
$attr->value = $query;
1960+
$includeElement->appendChild($attr);
19591961
$fallbackElement = $doc->createElement("xi:fallback");
19601962
$includeElement->appendChild(new DOMText("\n "));
19611963
$includeElement->appendChild($fallbackElement);

0 commit comments

Comments
 (0)