Skip to content

Commit

Permalink
Better spoiler and tags behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Kurczewski committed Mar 13, 2014
1 parent 87806bd commit a2b6474
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions public_html/media/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ ul.tagit input {
.spoiler:hover {
color: black;
}
.spoiler:not(:hover) a {
color: #eee;
}

img {
border: 0;
Expand Down
6 changes: 3 additions & 3 deletions src/CustomMarkdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -122,7 +122,7 @@ protected function doSpoilers($text)
{
if (is_array($text))
$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)
Expand Down

0 comments on commit a2b6474

Please sign in to comment.