1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-05 20:33:03 +02:00

Compare commits

..

3 Commits
0.4.3 ... 0.4.4

Author SHA1 Message Date
Emanuil Rusev
400c8f7d46 simplify regex for inline link in attempt to resolve #23 2013-11-08 00:24:40 +02:00
Emanuil Rusev
379cbf34b3 parse_block_elements doesn't have to use ltrim on lines with no indentation 2013-11-07 22:48:15 +02:00
Emanuil Rusev
b6c8cac512 optimize quick paragraph 2013-11-07 22:46:01 +02:00

View File

@@ -205,7 +205,7 @@ class Parsedown
# Quick Paragraph
if ($line[0] >= 'A' and $line[0] !== '_' and $line[0] !== '[')
if ($line[0] >= 'a' or $line[0] >= 'A' and $line[0] <= 'Z')
{
goto paragraph; # trust me
}
@@ -277,7 +277,7 @@ class Parsedown
# ~
$pure_line = ltrim($line);
$pure_line = $line[0] !== ' ' ? $line : ltrim($line);
# Link Reference
@@ -560,7 +560,7 @@ class Parsedown
# Inline Link / Image
if (strpos($text, '](') !== FALSE and preg_match_all('/(!?)(\[((?:[^][]+|(?2))*)\])\((.*?)\)/', $text, $matches, PREG_SET_ORDER)) # inline
if (strpos($text, '](') !== FALSE and preg_match_all('/(!?)(\[((?:[^\[\]]|(?2))*)\])\((.*?)\)/', $text, $matches, PREG_SET_ORDER)) # inline
{
foreach ($matches as $matches)
{