From a2b647432c1ce2e48438190b1fd6f70a11df22bb Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 13 Mar 2014 20:50:45 +0100 Subject: [PATCH] Better spoiler and tags behaviour --- public_html/media/css/core.css | 3 +++ src/CustomMarkdown.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 1a53b11b3..0dabe975e 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -430,6 +430,9 @@ ul.tagit input { .spoiler:hover { color: black; } +.spoiler:not(:hover) a { + color: #eee; +} img { border: 0; diff --git a/src/CustomMarkdown.php b/src/CustomMarkdown.php index 22e82da89..99acb544f 100644 --- a/src/CustomMarkdown.php +++ b/src/CustomMarkdown.php @@ -7,11 +7,11 @@ public function __construct($simple = false) { $this->simple = $simple; $this->no_markup = $simple; - $this->span_gamut += ['doSpoilers' => 71]; - $this->span_gamut += ['doSearchPermalinks' => 72]; $this->span_gamut += ['doStrike' => 6]; $this->span_gamut += ['doUsers' => 7]; $this->span_gamut += ['doPosts' => 8]; + $this->span_gamut += ['doSpoilers' => 8.5]; + $this->span_gamut += ['doSearchPermalinks' => 8.75]; $this->span_gamut += ['doTags' => 9]; $this->span_gamut += ['doAutoLinks2' => 29]; @@ -122,7 +122,7 @@ protected function doSpoilers($text) { if (is_array($text)) $text = $this->hashBlock('') . $this->runSpanGamut($text[1]) . $this->hashBlock(''); - return preg_replace_callback('{\[spoiler\]((?:[^\[]|\[(?!\/?spoiler\])|(?R))+)\[\/spoiler\]}is', [__CLASS__, 'doSpoilers'], $text); + return preg_replace_callback('{(?