Skip to content

Commit

Permalink
XML fragment fixup for refsect1 (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfsb authored Dec 20, 2024
1 parent f8e2caa commit 0389152
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ function xinclude_residual( DOMDocument $dom )
$fixup = "";
break;
case "refsect1":
$fixup = "<title></title>";
$fixup = "<title>_</title><simpara>_</simpara>"; // https://github.com/php/phd/issues/181
break;
case "tbody":
$fixup = "<row><entry></entry></row>";
Expand All @@ -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( "<f>$fixup</f>" );
foreach( $other->documentElement->childNodes as $otherNode )
{
$imported = $dom->importNode( $otherNode , true );
$node->parentNode->insertBefore( $imported , $node );
}
}
$node->parentNode->removeChild( $node );
}
Expand Down

0 comments on commit 0389152

Please sign in to comment.