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

Merge pull request #122 from wkpark/marker_index

use $closestMarkerIndex
This commit is contained in:
Emanuil Rusev 2014-02-27 14:14:14 +02:00
commit 886c620440

View File

@ -1127,14 +1127,14 @@ class Parsedown
if ($text[1] === $closestMarker and preg_match(self::$strongRegex[$closestMarker], $text, $matches)) if ($text[1] === $closestMarker and preg_match(self::$strongRegex[$closestMarker], $text, $matches))
{ {
$markers[] = $closestMarker; $markers[$closestMarkerIndex] = $closestMarker;
$matches[1] = $this->parseLine($matches[1], $markers); $matches[1] = $this->parseLine($matches[1], $markers);
$markup .= '<strong>'.$matches[1].'</strong>'; $markup .= '<strong>'.$matches[1].'</strong>';
} }
elseif (preg_match(self::$emRegex[$closestMarker], $text, $matches)) elseif (preg_match(self::$emRegex[$closestMarker], $text, $matches))
{ {
$markers[] = $closestMarker; $markers[$closestMarkerIndex] = $closestMarker;
$matches[1] = $this->parseLine($matches[1], $markers); $matches[1] = $this->parseLine($matches[1], $markers);
$markup .= '<em>'.$matches[1].'</em>'; $markup .= '<em>'.$matches[1].'</em>';