Skip to content

Commit bcff490

Browse files
committed
#3 add null question to parsedown-extra, stop escaping HTML
1 parent a313699 commit bcff490

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Helper/MarkdownPlusHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function markdown($text, $isPublicLink = false)
5858
{
5959
$emoji = new Client(new Ruleset());
6060
$parsecheckbox = new CoreMarkdown($this->container, $isPublicLink);
61-
$parsecheckbox->setMarkupEscaped(MARKDOWN_ESCAPE_HTML);
61+
//$parsecheckbox->setMarkupEscaped(MARKDOWN_ESCAPE_HTML);
6262
if ($this->configModel->get('unicode_shortcode', '2') == 1)
6363
return $emoji->shortnameToUnicode($parsecheckbox->text($text));
6464
else

vendor/erusev/parsedown-extra/ParsedownExtra.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,15 @@ protected function blockMarkupComplete($Block)
237237
protected function blockSetextHeader($Line, array $Block = null)
238238
{
239239
$Block = parent::blockSetextHeader($Line, $Block);
240-
241-
if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
242-
{
243-
$attributeString = $matches[1][0];
244-
245-
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
246-
247-
$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
240+
if (!is_null($Block)) {
241+
if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
242+
{
243+
$attributeString = $matches[1][0];
244+
245+
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
246+
247+
$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
248+
}
248249
}
249250

250251
return $Block;

0 commit comments

Comments
 (0)