Code Duplication    Length = 7-7 lines in 2 locations

includes/parser/Parser.php 2 locations

@@ 5452-5458 (lines=7) @@
5449
			$targetLevel = 1000;
5450
		} else {
5451
			while ( $node ) {
5452
				if ( $node->getName() === 'h' ) {
5453
					$bits = $node->splitHeading();
5454
					if ( $bits['i'] == $sectionIndex ) {
5455
						$targetLevel = $bits['level'];
5456
						break;
5457
					}
5458
				}
5459
				if ( $mode === 'replace' ) {
5460
					$outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG );
5461
				}
@@ 5477-5483 (lines=7) @@
5474
5475
		# Find the end of the section, including nested sections
5476
		do {
5477
			if ( $node->getName() === 'h' ) {
5478
				$bits = $node->splitHeading();
5479
				$curLevel = $bits['level'];
5480
				if ( $bits['i'] != $sectionIndex && $curLevel <= $targetLevel ) {
5481
					break;
5482
				}
5483
			}
5484
			if ( $mode === 'get' ) {
5485
				$outText .= $frame->expand( $node, PPFrame::RECOVER_ORIG );
5486
			}