@@ 5509-5515 (lines=7) @@ | ||
5506 | $targetLevel = 1000; |
|
5507 | } else { |
|
5508 | while ( $node ) { |
|
5509 | if ( $node->getName() === 'h' ) { |
|
5510 | $bits = $node->splitHeading(); |
|
5511 | if ( $bits['i'] == $sectionIndex ) { |
|
5512 | $targetLevel = $bits['level']; |
|
5513 | break; |
|
5514 | } |
|
5515 | } |
|
5516 | if ( $mode === 'replace' ) { |
|
5517 | $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
|
5518 | } |
|
@@ 5534-5540 (lines=7) @@ | ||
5531 | ||
5532 | # Find the end of the section, including nested sections |
|
5533 | do { |
|
5534 | if ( $node->getName() === 'h' ) { |
|
5535 | $bits = $node->splitHeading(); |
|
5536 | $curLevel = $bits['level']; |
|
5537 | if ( $bits['i'] != $sectionIndex && $curLevel <= $targetLevel ) { |
|
5538 | break; |
|
5539 | } |
|
5540 | } |
|
5541 | if ( $mode === 'get' ) { |
|
5542 | $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
|
5543 | } |