mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
backtick within code span
This commit is contained in:
parent
e20c0a29bd
commit
f0fbdaa6ca
@ -948,9 +948,9 @@ class Parsedown
|
|||||||
|
|
||||||
case '`':
|
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');
|
$element_text = htmlspecialchars($element_text, ENT_NOQUOTES, 'UTF-8');
|
||||||
|
|
||||||
$markup .= '<code>'.$element_text.'</code>';
|
$markup .= '<code>'.$element_text.'</code>';
|
||||||
|
Loading…
Reference in New Issue
Block a user