1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-02 19:32:35 +02:00

Preserve plain-text in AST to avoid blinding extensions to it

This commit is contained in:
Aidan Woods
2018-05-08 22:32:57 +01:00
parent c9e7183cfa
commit 4686daf8c2

View File

@@ -1215,14 +1215,14 @@ class Parsedown
'element' => array(),
);
$safeText = self::escape($text, true);
$Inline['element']['rawHtml'] = preg_replace(
$Inline['element']['elements'] = self::pregReplaceElements(
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/',
"<br />\n",
$safeText
array(
array('name' => 'br'),
array('text' => "\n"),
),
$text
);
$Inline['element']['allowRawHtmlInSafeMode'] = true;
return $Inline;
}