Stop stripping comments in TOC data

The parserTest "PageImages with toc and image in heading" covers the
case of PageImages comments being left around in TOC data.

Depends-On: I10f96435f892b188cffe64b92cdf2701a3e2058b
Change-Id: Ie6760dd25f937d4f6acbab1c0e1475b54878d4ed
This commit is contained in:
Arlo Breault 2024-02-20 18:10:56 -05:00
parent abf45611d7
commit d031b380db

View file

@ -170,11 +170,7 @@ class ParserFileProcessingHookHandlers implements
$parserOutput->setIndicator( $id, $stripped );
}
}
// Strip comments from TOC data
$tocData = $parserOutput->getTOCData();
foreach ( ( $tocData ? $tocData->getSections() : [] ) as $section ) {
$section->line = trim( preg_replace( self::CANDIDATE_REGEX, '', $section->line ) );
}
// We may have comments in TOC data - Parser::cleanupTocLine strips them for us.
}
/**