mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
rewrite parse_block_elements() to remove goto
The goto clause is the only thing which prevents this class to be PHP 5.2-compatible. Also, goto is evil.
This commit is contained in:
parent
ee9a1e92c0
commit
9eedcc3386
@ -205,10 +205,8 @@ class Parsedown
|
|||||||
|
|
||||||
# Quick Paragraph
|
# Quick Paragraph
|
||||||
|
|
||||||
if ($line[0] >= 'a' or $line[0] >= 'A' and $line[0] <= 'Z')
|
if (!($line[0] >= 'a' or $line[0] >= 'A' and $line[0] <= 'Z'))
|
||||||
{
|
{
|
||||||
goto paragraph;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Code
|
# Code
|
||||||
|
|
||||||
@ -391,8 +389,9 @@ class Parsedown
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
}
|
||||||
|
|
||||||
paragraph:
|
# Paragraph
|
||||||
|
|
||||||
if ($element['type'] === 'p')
|
if ($element['type'] === 'p')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user