| @@ 5459-5465 (lines=7) @@ | ||
| 5456 | $targetLevel = 1000; |
|
| 5457 | } else { |
|
| 5458 | while ( $node ) { |
|
| 5459 | if ( $node->getName() === 'h' ) { |
|
| 5460 | $bits = $node->splitHeading(); |
|
| 5461 | if ( $bits['i'] == $sectionIndex ) { |
|
| 5462 | $targetLevel = $bits['level']; |
|
| 5463 | break; |
|
| 5464 | } |
|
| 5465 | } |
|
| 5466 | if ( $mode === 'replace' ) { |
|
| 5467 | $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
|
| 5468 | } |
|
| @@ 5484-5490 (lines=7) @@ | ||
| 5481 | ||
| 5482 | # Find the end of the section, including nested sections |
|
| 5483 | do { |
|
| 5484 | if ( $node->getName() === 'h' ) { |
|
| 5485 | $bits = $node->splitHeading(); |
|
| 5486 | $curLevel = $bits['level']; |
|
| 5487 | if ( $bits['i'] != $sectionIndex && $curLevel <= $targetLevel ) { |
|
| 5488 | break; |
|
| 5489 | } |
|
| 5490 | } |
|
| 5491 | if ( $mode === 'get' ) { |
|
| 5492 | $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
|
| 5493 | } |
|