mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Implement Emphasis
This commit is contained in:
@@ -411,35 +411,6 @@ class Parsedown
|
||||
return $Elements;
|
||||
}
|
||||
|
||||
protected function inlineEmphasis($Excerpt)
|
||||
{
|
||||
if (! isset($Excerpt['text'][1])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$marker = $Excerpt['text'][0];
|
||||
|
||||
if ($Excerpt['text'][1] === $marker and \preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) {
|
||||
$emphasis = 'strong';
|
||||
} elseif (\preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) {
|
||||
$emphasis = 'em';
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
return [
|
||||
'extent' => \strlen($matches[0]),
|
||||
'element' => [
|
||||
'name' => $emphasis,
|
||||
'handler' => [
|
||||
'function' => 'lineElements',
|
||||
'argument' => $matches[1],
|
||||
'destination' => 'elements',
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
protected function inlineEscapeSequence($Excerpt)
|
||||
{
|
||||
if (isset($Excerpt['text'][1]) and \in_array($Excerpt['text'][1], $this->specialCharacters, true)) {
|
||||
|
||||
Reference in New Issue
Block a user