From 9c0ed1e9304660a54fa3b993760c4dc8f7c90eb3 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 21 Nov 2013 22:47:55 +0100 Subject: [PATCH] Markdown: fixed some [spoiler] bugs --- src/CustomMarkdown.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CustomMarkdown.php b/src/CustomMarkdown.php index 3eb87bf7..ca180f1d 100644 --- a/src/CustomMarkdown.php +++ b/src/CustomMarkdown.php @@ -4,7 +4,7 @@ class CustomMarkdown extends \Michelf\Markdown public function __construct() { $this->no_markup = true; - $this->span_gamut += ['doSpoilers' => 71]; + $this->block_gamut += ['doSpoilers' => 71]; $this->span_gamut += ['doSearchPermalinks' => 72]; $this->span_gamut += ['doStrike' => 6]; $this->span_gamut += ['doUsers' => 7]; @@ -58,7 +58,7 @@ class CustomMarkdown extends \Michelf\Markdown protected function doSpoilers($text) { if (is_array($text)) - $text = $this->hashPart('') . $text[1] . $this->hashPart(''); + $text = $this->hashBlock('') . $this->runSpanGamut($text[1]) . $this->hashBlock(''); return preg_replace_callback('{\[spoiler\]((?:[^\[]|\[(?!\/?spoiler\])|(?R))+)\[\/spoiler\]}is', [__CLASS__, 'doSpoilers'], $text); }