Skip to content

Commit

Permalink
#3 add null question to parsedown-extra, stop escaping HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
creecros committed Mar 18, 2021
1 parent a313699 commit bcff490
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Helper/MarkdownPlusHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function markdown($text, $isPublicLink = false)
{
$emoji = new Client(new Ruleset());
$parsecheckbox = new CoreMarkdown($this->container, $isPublicLink);
$parsecheckbox->setMarkupEscaped(MARKDOWN_ESCAPE_HTML);
//$parsecheckbox->setMarkupEscaped(MARKDOWN_ESCAPE_HTML);
if ($this->configModel->get('unicode_shortcode', '2') == 1)
return $emoji->shortnameToUnicode($parsecheckbox->text($text));
else
Expand Down
17 changes: 9 additions & 8 deletions vendor/erusev/parsedown-extra/ParsedownExtra.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,15 @@ protected function blockMarkupComplete($Block)
protected function blockSetextHeader($Line, array $Block = null)
{
$Block = parent::blockSetextHeader($Line, $Block);

if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
{
$attributeString = $matches[1][0];

$Block['element']['attributes'] = $this->parseAttributeData($attributeString);

$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
if (!is_null($Block)) {
if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
{
$attributeString = $matches[1][0];

$Block['element']['attributes'] = $this->parseAttributeData($attributeString);

$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
}
}

return $Block;
Expand Down

0 comments on commit bcff490

Please sign in to comment.