Skip to content

Commit

Permalink
Merge pull request #628 from aidantwoods/fix/revert-rawHtml-breaks-in…
Browse files Browse the repository at this point in the history
…sertion

Preserve plain-text in AST to avoid blinding extensions to it
  • Loading branch information
aidantwoods authored May 8, 2018
2 parents c9e7183 + 4686daf commit c83af0a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Parsedown.php
Original file line number Diff line number Diff line change
Expand Up @@ -1215,14 +1215,14 @@ protected function inlineText($text)
'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;
}
Expand Down

0 comments on commit c83af0a

Please sign in to comment.