mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #628 from aidantwoods/fix/revert-rawHtml-breaks-insertion
Preserve plain-text in AST to avoid blinding extensions to it
This commit is contained in:
commit
c83af0a7d5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user