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

simplify reference

This commit is contained in:
Emanuil Rusev 2014-02-06 02:36:22 +02:00
parent abb88d59fa
commit 611aed179d

View File

@ -476,22 +476,19 @@ class Parsedown
if ($substring !== false)
{
if ($substring[0] !== '"' and $substring[0] !== "'" and $substring[0] !== '(')
{
break;
}
$last_char = substr($substring, -1);
switch (true)
if ($last_char !== '"' and $last_char !== "'" and $last_char !== ')')
{
case $substring[0] === '"' and $substring[0] === $last_char:
case $substring[0] === "'" and $substring[0] === $last_char:
case $substring[0] === '(' and $last_char === ')':
$reference['#'] = substr($substring, 1, -1);
break;
default:
break 2;
break;
}
$reference['#'] = substr($substring, 1, -1);
}
$this->reference_map[$label] = $reference;