mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
simplify parsing of code blocks
This commit is contained in:
parent
f43f54b877
commit
e475602e2f
@ -128,8 +128,6 @@ class Parsedown
|
||||
{
|
||||
$element['interrupted'] = true;
|
||||
|
||||
$element['type'] === 'code' and $element['text'] .= "\n";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -251,6 +249,8 @@ class Parsedown
|
||||
{
|
||||
if ($element['type'] === 'code')
|
||||
{
|
||||
isset($element['interrupted']) and $element['text'] .= "\n";
|
||||
|
||||
$element['text'] .= "\n".$matches[1];
|
||||
}
|
||||
else
|
||||
@ -415,9 +415,7 @@ class Parsedown
|
||||
|
||||
case 'code':
|
||||
|
||||
$text = rtrim($element['text'], "\n");
|
||||
|
||||
$text = htmlentities($text, ENT_NOQUOTES);
|
||||
$text = htmlentities($element['text'], ENT_NOQUOTES);
|
||||
|
||||
strpos($text, "\x1A\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user