Skip to content

Commit 0389152

Browse files
authored
XML fragment fixup for refsect1 (#208)
1 parent f8e2caa commit 0389152

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

configure.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ function xinclude_residual( DOMDocument $dom )
964964
$fixup = "";
965965
break;
966966
case "refsect1":
967-
$fixup = "<title></title>";
967+
$fixup = "<title>_</title><simpara>_</simpara>"; // https://github.com/php/phd/issues/181
968968
break;
969969
case "tbody":
970970
$fixup = "<row><entry></entry></row>";
@@ -980,9 +980,12 @@ function xinclude_residual( DOMDocument $dom )
980980
if ( $fixup != "" )
981981
{
982982
$other = new DOMDocument( '1.0' , 'utf8' );
983-
$other->loadXML( $fixup );
984-
$insert = $dom->importNode( $other->documentElement , true );
985-
$node->parentNode->insertBefore( $insert , $node );
983+
$other->loadXML( "<f>$fixup</f>" );
984+
foreach( $other->documentElement->childNodes as $otherNode )
985+
{
986+
$imported = $dom->importNode( $otherNode , true );
987+
$node->parentNode->insertBefore( $imported , $node );
988+
}
986989
}
987990
$node->parentNode->removeChild( $node );
988991
}

0 commit comments

Comments
 (0)