1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

fix [0] reference labels

This commit is contained in:
Emanuil Rusev 2014-02-23 23:43:18 +02:00
parent 9fd9262f16
commit 0985c2ef29

View File

@ -1027,7 +1027,7 @@ class Parsedown
if (preg_match('/^\s*\[(.*?)\]/', $remaining_text, $matches)) if (preg_match('/^\s*\[(.*?)\]/', $remaining_text, $matches))
{ {
$reference = $matches[1] ? $matches[1] : $element['text']; $reference = $matches[1] === '' ? $element['text'] : $matches[1];
$offset += strlen($matches[0]); $offset += strlen($matches[0]);
} }