mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Preserve plain-text in AST to avoid blinding extensions to it
This commit is contained in:
parent
c9e7183cfa
commit
4686daf8c2
@ -1215,14 +1215,14 @@ class Parsedown
|
|||||||
'element' => array(),
|
'element' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
$safeText = self::escape($text, true);
|
$Inline['element']['elements'] = self::pregReplaceElements(
|
||||||
|
|
||||||
$Inline['element']['rawHtml'] = preg_replace(
|
|
||||||
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/',
|
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/',
|
||||||
"<br />\n",
|
array(
|
||||||
$safeText
|
array('name' => 'br'),
|
||||||
|
array('text' => "\n"),
|
||||||
|
),
|
||||||
|
$text
|
||||||
);
|
);
|
||||||
$Inline['element']['allowRawHtmlInSafeMode'] = true;
|
|
||||||
|
|
||||||
return $Inline;
|
return $Inline;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user