mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
parent
95e9878fb0
commit
d25466fa8f
@ -1028,9 +1028,9 @@ class Parsedown
|
|||||||
|
|
||||||
case '`':
|
case '`':
|
||||||
|
|
||||||
if (preg_match('/^(`+)[ ]*(.+?)[ ]*\1(?!`)/', $text, $matches))
|
if (preg_match('/^(`+)([ ]?)(.+?)\2\1(?!`)/', $text, $matches))
|
||||||
{
|
{
|
||||||
$element_text = $matches[2];
|
$element_text = $matches[3];
|
||||||
$element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
|
$element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
|
||||||
|
|
||||||
$markup .= '<code>'.$element_text.'</code>';
|
$markup .= '<code>'.$element_text.'</code>';
|
||||||
|
@ -3,3 +3,7 @@
|
|||||||
<p><code>and look at this one!</code></p>
|
<p><code>and look at this one!</code></p>
|
||||||
<p>single backtick in a code span: <code>`</code></p>
|
<p>single backtick in a code span: <code>`</code></p>
|
||||||
<p>backtick-delimited string in a code span: <code>`foo`</code></p>
|
<p>backtick-delimited string in a code span: <code>`foo`</code></p>
|
||||||
|
<p>Trim spaces: <code>code</code></p>
|
||||||
|
<p>Multiple spaces: <code> like that </code></p>
|
||||||
|
<p>Unequal number of spaces: <code> like that </code></p>
|
||||||
|
<p>Space only at the beginning: <code> code</code></p>
|
@ -7,3 +7,11 @@ a `code span`
|
|||||||
single backtick in a code span: `` ` ``
|
single backtick in a code span: `` ` ``
|
||||||
|
|
||||||
backtick-delimited string in a code span: `` `foo` ``
|
backtick-delimited string in a code span: `` `foo` ``
|
||||||
|
|
||||||
|
Trim spaces: `` code ``
|
||||||
|
|
||||||
|
Multiple spaces: `` like that ``
|
||||||
|
|
||||||
|
Unequal number of spaces: `` like that ``
|
||||||
|
|
||||||
|
Space only at the beginning: `` code``
|
Loading…
Reference in New Issue
Block a user