From 0389152607a818f13a2e1a84a693c319c85edfba Mon Sep 17 00:00:00 2001 From: alfsb Date: Fri, 20 Dec 2024 12:34:21 -0300 Subject: [PATCH] XML fragment fixup for `refsect1` (#208) --- configure.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.php b/configure.php index 3519a63a0..078c66e53 100755 --- a/configure.php +++ b/configure.php @@ -964,7 +964,7 @@ function xinclude_residual( DOMDocument $dom ) $fixup = ""; break; case "refsect1": - $fixup = ""; + $fixup = "__"; // https://github.com/php/phd/issues/181 break; case "tbody": $fixup = ""; @@ -980,9 +980,12 @@ function xinclude_residual( DOMDocument $dom ) if ( $fixup != "" ) { $other = new DOMDocument( '1.0' , 'utf8' ); - $other->loadXML( $fixup ); - $insert = $dom->importNode( $other->documentElement , true ); - $node->parentNode->insertBefore( $insert , $node ); + $other->loadXML( "$fixup" ); + foreach( $other->documentElement->childNodes as $otherNode ) + { + $imported = $dom->importNode( $otherNode , true ); + $node->parentNode->insertBefore( $imported , $node ); + } } $node->parentNode->removeChild( $node ); }