mirror of
https://github.com/erusev/parsedown.git
synced 2025-09-08 13:50:53 +02:00
Allow inlines to backtrack into characters that were suspected as
inlines but ruled out This is required for backslash escaped Hard breaks to work: Parsedown first checks to see if these are escape sequences, however when they are ruled out they should not be assumed to be plaintext since a later inline (Hardbreak) may backtrack into these unconsumed characters.
This commit is contained in:
@@ -306,16 +306,8 @@ final class Parsedown
|
||||
continue 2;
|
||||
}
|
||||
|
||||
if (! isset($startPosition)) {
|
||||
$startPosition = $Excerpt->offset();
|
||||
}
|
||||
|
||||
# the marker does not belong to an inline
|
||||
|
||||
$Inlines[] = Plaintext::build($Excerpt->choppingUpToOffset($startPosition + 1));
|
||||
|
||||
/** @psalm-suppress LoopInvalidation */
|
||||
$Excerpt = $Excerpt->choppingFromOffset($startPosition + 1);
|
||||
$Excerpt = $Excerpt->addingToOffset(1);
|
||||
}
|
||||
|
||||
$Inlines[] = Plaintext::build($Excerpt->choppingFromOffset(0));
|
||||
|
Reference in New Issue
Block a user