StringUtils::explode() returns an ExplodeIterator if the number of
separators is too high, which doesn't implement count.
So count the way that explode does.
Bug: T218817
Change-Id: I22eebb70af1b19d7c25241fc78bfcced4470e78a
# happening here is handling of block-level elements p, pre,
# and making lists from lines starting with * # : etc.
$textLines = StringUtils::explode( "\n", $text );
+ $lineCount = substr_count( $text, "\n" ) + 1;
$lastPrefix = $output = '';
$this->DTopen = $inBlockElem = false;
$pendingPTag = false;
$inBlockquote = false;
- $lineCount = count( $textLines );
foreach ( $textLines as $i => $inputLine ) {
# Fix up $lineStart
if ( !$this->lineStart ) {