1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
Zoë Blade 2021-03-08 17:30:53 +00:00
parent 6598f3860c
commit fccbf91aa6

View File

@ -1113,6 +1113,7 @@ class Parsedown
':' => array('Url'),
'<' => array('UrlTag', 'EmailTag', 'Markup'),
'[' => array('Link'),
'^' => array('Superscript'),
'_' => array('Emphasis'),
'`' => array('Code'),
'~' => array('Strikethrough'),
@ -1121,7 +1122,7 @@ class Parsedown
# ~
protected $inlineMarkerList = '!*_&[:<`~\\';
protected $inlineMarkerList = '!*_&[^:<`~\\';
#
# ~
@ -1529,6 +1530,29 @@ class Parsedown
}
}
protected function inlineSuperscript($Excerpt)
{
if ( ! isset($Excerpt['text'][1]))
{
return;
}
if ($Excerpt['text'][1] === '^' and preg_match('/^\^\^(?=\S)(.+?)(?<=\S)\^\^/', $Excerpt['text'], $matches))
{
return array(
'extent' => strlen($matches[0]),
'element' => array(
'name' => 'sup',
'handler' => array(
'function' => 'lineElements',
'argument' => $matches[1],
'destination' => 'elements',
)
),
);
}
}
protected function inlineUrl($Excerpt)
{
if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/')
@ -1961,7 +1985,7 @@ class Parsedown
# Read-Only
protected $specialCharacters = array(
'\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!', '|', '~'
'\\', '`', '*', '_', '{', '}', '[', ']', '^', '(', ')', '>', '#', '+', '-', '.', '!', '|', '~'
);
protected $StrongRegex = array(