From b4f478909b0cb015acbfd666d18bd872956a1f47 Mon Sep 17 00:00:00 2001
From: Jordi Kroon
Date: Sat, 21 Nov 2026 19:11:50 +0100
Subject: [PATCH] Allow linking to individual constants within a shared term
---
phpdotnet/phd/Package/Generic/XHTML.php | 3 +++
tests/package/php/constant_links_001.phpt | 16 ++++++++++++++++
tests/package/php/data/constant_links.xml | 16 ++++++++++++++++
3 files changed, 35 insertions(+)
diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php
index 3bd5973b0..734486de4 100644
--- a/phpdotnet/phd/Package/Generic/XHTML.php
+++ b/phpdotnet/phd/Package/Generic/XHTML.php
@@ -2122,6 +2122,9 @@ public function format_constant($open, $name, $attrs, $props)
$this->pushRole("constant_group");
$this->cchunk["constant"] = $props["innerXml"];
}
+ if (isset($attrs[Reader::XMLNS_XML]["id"])) {
+ return '';
+ }
return "";
}
diff --git a/tests/package/php/constant_links_001.phpt b/tests/package/php/constant_links_001.phpt
index e41ecb51c..7df5e537c 100644
--- a/tests/package/php/constant_links_001.phpt
+++ b/tests/package/php/constant_links_001.phpt
@@ -95,4 +95,20 @@ Content:
+
+
5. Constants sharing a description have their own ID
+
+
+ -
+
FIRST_ALIAS,
+ SECOND_ALIAS
+ (bool)
+
+ -
+
Shared description
+
+
+
+
+
diff --git a/tests/package/php/data/constant_links.xml b/tests/package/php/data/constant_links.xml
index ea2b9f792..a83c0da36 100644
--- a/tests/package/php/data/constant_links.xml
+++ b/tests/package/php/data/constant_links.xml
@@ -36,4 +36,20 @@
+
+ 5. Constants sharing a description have their own ID
+
+
+
+ FIRST_ALIAS,
+ SECOND_ALIAS
+ (bool)
+
+
+ Shared description
+
+
+
+
+