mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
remove unnecessary nesting
This commit is contained in:
parent
cf7f32f891
commit
eab3cbf255
@ -916,36 +916,38 @@ class Parsedown
|
|||||||
|
|
||||||
$Span = $this->$handler($markedExcerpt, $text);
|
$Span = $this->$handler($markedExcerpt, $text);
|
||||||
|
|
||||||
if (isset($Span))
|
if ( ! isset($Span))
|
||||||
{
|
{
|
||||||
# The identified span can be ahead of the marker.
|
continue;
|
||||||
|
|
||||||
if (isset($Span['position']) and $Span['position'] > $markerPosition)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Spans that start at the position of their marker don't have to set a position.
|
|
||||||
|
|
||||||
if ( ! isset($Span['position']))
|
|
||||||
{
|
|
||||||
$Span['position'] = $markerPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
$unmarkedText = substr($text, 0, $Span['position']);
|
|
||||||
|
|
||||||
$markup .= $this->readPlainText($unmarkedText);
|
|
||||||
|
|
||||||
$markup .= isset($Span['element']) ? $this->element($Span['element']) : $Span['markup'];
|
|
||||||
|
|
||||||
$text = substr($text, $Span['position'] + $Span['extent']);
|
|
||||||
|
|
||||||
$remainder = $text;
|
|
||||||
|
|
||||||
$markerPosition = 0;
|
|
||||||
|
|
||||||
continue 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The identified span can be ahead of the marker.
|
||||||
|
|
||||||
|
if (isset($Span['position']) and $Span['position'] > $markerPosition)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Spans that start at the position of their marker don't have to set a position.
|
||||||
|
|
||||||
|
if ( ! isset($Span['position']))
|
||||||
|
{
|
||||||
|
$Span['position'] = $markerPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
$unmarkedText = substr($text, 0, $Span['position']);
|
||||||
|
|
||||||
|
$markup .= $this->readPlainText($unmarkedText);
|
||||||
|
|
||||||
|
$markup .= isset($Span['element']) ? $this->element($Span['element']) : $Span['markup'];
|
||||||
|
|
||||||
|
$text = substr($text, $Span['position'] + $Span['extent']);
|
||||||
|
|
||||||
|
$remainder = $text;
|
||||||
|
|
||||||
|
$markerPosition = 0;
|
||||||
|
|
||||||
|
continue 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$remainder = substr($markedExcerpt, 1);
|
$remainder = substr($markedExcerpt, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user