1
0
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:
Dimitar Dimitrov 2013-11-10 02:26:39 +02:00
parent ee9a1e92c0
commit 9eedcc3386

View File

@ -205,10 +205,8 @@ class Parsedown
# 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
@ -391,8 +389,9 @@ class Parsedown
}
# ~
}
paragraph:
# Paragraph
if ($element['type'] === 'p')
{