simplify parsing of code blocks
This commit is contained in:
parent
f43f54b877
commit
e475602e2f
|
@ -128,8 +128,6 @@ class Parsedown
|
||||||
{
|
{
|
||||||
$element['interrupted'] = true;
|
$element['interrupted'] = true;
|
||||||
|
|
||||||
$element['type'] === 'code' and $element['text'] .= "\n";
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,6 +249,8 @@ class Parsedown
|
||||||
{
|
{
|
||||||
if ($element['type'] === 'code')
|
if ($element['type'] === 'code')
|
||||||
{
|
{
|
||||||
|
isset($element['interrupted']) and $element['text'] .= "\n";
|
||||||
|
|
||||||
$element['text'] .= "\n".$matches[1];
|
$element['text'] .= "\n".$matches[1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -415,9 +415,7 @@ class Parsedown
|
||||||
|
|
||||||
case 'code':
|
case 'code':
|
||||||
|
|
||||||
$text = rtrim($element['text'], "\n");
|
$text = htmlentities($element['text'], ENT_NOQUOTES);
|
||||||
|
|
||||||
$text = htmlentities($text, ENT_NOQUOTES);
|
|
||||||
|
|
||||||
strpos($text, "\x1A\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map);
|
strpos($text, "\x1A\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue