backtick within code span

This commit is contained in:
Emanuil Rusev 2014-01-22 21:28:09 +02:00
parent e20c0a29bd
commit f0fbdaa6ca

View File

@ -948,9 +948,9 @@ class Parsedown
case '`':
if (preg_match('/^`(.+?)`/', $text, $matches))
if (preg_match('/^(`+)(.+?)\1(?!`)/', $text, $matches))
{
$element_text = $matches[1];
$element_text = $matches[2];
$element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
$markup .= '<code>'.$element_text.'</code>';