| @@ 5409-5415 (lines=7) @@ | ||
| 5406 | $targetLevel = 1000; |
|
| 5407 | } else { |
|
| 5408 | while ( $node ) { |
|
| 5409 | if ( $node->getName() === 'h' ) { |
|
| 5410 | $bits = $node->splitHeading(); |
|
| 5411 | if ( $bits['i'] == $sectionIndex ) { |
|
| 5412 | $targetLevel = $bits['level']; |
|
| 5413 | break; |
|
| 5414 | } |
|
| 5415 | } |
|
| 5416 | if ( $mode === 'replace' ) { |
|
| 5417 | $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
|
| 5418 | } |
|
| @@ 5434-5440 (lines=7) @@ | ||
| 5431 | ||
| 5432 | # Find the end of the section, including nested sections |
|
| 5433 | do { |
|
| 5434 | if ( $node->getName() === 'h' ) { |
|
| 5435 | $bits = $node->splitHeading(); |
|
| 5436 | $curLevel = $bits['level']; |
|
| 5437 | if ( $bits['i'] != $sectionIndex && $curLevel <= $targetLevel ) { |
|
| 5438 | break; |
|
| 5439 | } |
|
| 5440 | } |
|
| 5441 | if ( $mode === 'get' ) { |
|
| 5442 | $outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG ); |
|
| 5443 | } |
|