From f4ec384d03478e2340cf667bb5f1a80c3ac495ca Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Thu, 6 Feb 2014 11:00:19 +0200 Subject: [PATCH] Allow adjacent code spans Fix #92. --- Parsedown.php | 2 +- tests/data/code_span_adjacent.html | 1 + tests/data/code_span_adjacent.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/data/code_span_adjacent.html create mode 100644 tests/data/code_span_adjacent.md diff --git a/Parsedown.php b/Parsedown.php index 3f74776..f8ef2ea 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -1028,7 +1028,7 @@ class Parsedown case '`': - if (preg_match('/^(`+)[ ]*(.+?)[ ]*\1(?!`)/', $text, $matches)) + if (preg_match('/^(`+)[ ]*(.+?)[ ]*\1/', $text, $matches)) { $element_text = $matches[2]; $element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8'); diff --git a/tests/data/code_span_adjacent.html b/tests/data/code_span_adjacent.html new file mode 100644 index 0000000..d619138 --- /dev/null +++ b/tests/data/code_span_adjacent.html @@ -0,0 +1 @@ +

code spananother code span

\ No newline at end of file diff --git a/tests/data/code_span_adjacent.md b/tests/data/code_span_adjacent.md new file mode 100644 index 0000000..6281d20 --- /dev/null +++ b/tests/data/code_span_adjacent.md @@ -0,0 +1 @@ +`code span``another code span` \ No newline at end of file