mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Clarify sequential lines being tracked are empty
This commit is contained in:
parent
8d09320009
commit
39b8b04d33
@ -57,23 +57,23 @@ final class Lines
|
|||||||
$text = \str_replace(["\r\n", "\r"], "\n", $text);
|
$text = \str_replace(["\r\n", "\r"], "\n", $text);
|
||||||
|
|
||||||
$Contexts = [];
|
$Contexts = [];
|
||||||
$sequentialLines = '';
|
$sequentialEmptyLines = '';
|
||||||
|
|
||||||
foreach (\explode("\n", $text) as $line) {
|
foreach (\explode("\n", $text) as $line) {
|
||||||
if (\chop($line) === '') {
|
if (\chop($line) === '') {
|
||||||
$sequentialLines .= $line . "\n";
|
$sequentialEmptyLines .= $line . "\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Contexts[] = new Context(
|
$Contexts[] = new Context(
|
||||||
new Line($line, $indentOffset),
|
new Line($line, $indentOffset),
|
||||||
$sequentialLines
|
$sequentialEmptyLines
|
||||||
);
|
);
|
||||||
|
|
||||||
$sequentialLines = '';
|
$sequentialEmptyLines = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return new self($Contexts, $sequentialLines);
|
return new self($Contexts, $sequentialEmptyLines);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return bool */
|
/** @return bool */
|
||||||
|
Loading…
Reference in New Issue
Block a user