Code Duplication    Length = 7-7 lines in 2 locations

includes/parser/Parser.php 2 locations

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