From f0fbdaa6ca02e7437da12cc40ff7ea1af380a4ba Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Wed, 22 Jan 2014 21:28:09 +0200 Subject: [PATCH] backtick within code span --- Parsedown.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 4856d13..1c93fb3 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -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 .= ''.$element_text.'';