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);
}