Better spoiler and tags behaviour

This commit is contained in:
Marcin Kurczewski 2014-03-13 20:50:45 +01:00
parent 87806bd015
commit a2b647432c
2 changed files with 6 additions and 3 deletions

View file

@ -430,6 +430,9 @@ ul.tagit input {
.spoiler:hover { .spoiler:hover {
color: black; color: black;
} }
.spoiler:not(:hover) a {
color: #eee;
}
img { img {
border: 0; border: 0;

View file

@ -7,11 +7,11 @@ class CustomMarkdown extends \Michelf\MarkdownExtra
{ {
$this->simple = $simple; $this->simple = $simple;
$this->no_markup = $simple; $this->no_markup = $simple;
$this->span_gamut += ['doSpoilers' => 71];
$this->span_gamut += ['doSearchPermalinks' => 72];
$this->span_gamut += ['doStrike' => 6]; $this->span_gamut += ['doStrike' => 6];
$this->span_gamut += ['doUsers' => 7]; $this->span_gamut += ['doUsers' => 7];
$this->span_gamut += ['doPosts' => 8]; $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 += ['doTags' => 9];
$this->span_gamut += ['doAutoLinks2' => 29]; $this->span_gamut += ['doAutoLinks2' => 29];
@ -122,7 +122,7 @@ class CustomMarkdown extends \Michelf\MarkdownExtra
{ {
if (is_array($text)) if (is_array($text))
$text = $this->hashBlock('<span class="spoiler">') . $this->runSpanGamut($text[1]) . $this->hashBlock('</span>'); $text = $this->hashBlock('<span class="spoiler">') . $this->runSpanGamut($text[1]) . $this->hashBlock('</span>');
return preg_replace_callback('{\[spoiler\]((?:[^\[]|\[(?!\/?spoiler\])|(?R))+)\[\/spoiler\]}is', [__CLASS__, 'doSpoilers'], $text); return preg_replace_callback('{(?<!#)\[spoiler\]((?:[^\[]|\[(?!\/?spoiler\])|(?R))+)\[\/spoiler\]}is', [__CLASS__, 'doSpoilers'], $text);
} }
protected function doPosts($text) protected function doPosts($text)