summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Chars.pm2
-rw-r--r--lib/VNDBUtil.pm8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/Chars.pm b/lib/VNDB/Handler/Chars.pm
index dfa289be..9308cecf 100644
--- a/lib/VNDB/Handler/Chars.pm
+++ b/lib/VNDB/Handler/Chars.pm
@@ -233,7 +233,7 @@ sub charTable {
td class => 'chardesc', colspan => 2;
h2 mt '_charp_description';
p;
- lit bb2html $r->{desc};
+ lit bb2html $r->{desc}, 0, 1;
end;
end;
end;
diff --git a/lib/VNDBUtil.pm b/lib/VNDBUtil.pm
index a0469a1c..76290013 100644
--- a/lib/VNDBUtil.pm
+++ b/lib/VNDBUtil.pm
@@ -27,8 +27,7 @@ sub shorten {
# v+, v+.+
# http://../
sub bb2html {
- my $raw = shift;
- my $maxlength = shift;
+ my($raw, $maxlength, $charspoil) = @_;
$raw =~ s/\r//g;
return '' if !$raw && $raw ne "0";
@@ -76,7 +75,8 @@ sub bb2html {
next;
} elsif($tag eq '[spoiler]') {
push @open, 'spoiler';
- $result .= '<b class="spoiler">';
+ $result .= !$charspoil ? '<b class="spoiler">'
+ : '<b class="grayedout charspoil charspoil_-1">&lt;hidden by spoiler settings&gt;</b><span class="charspoil charspoil_2 hidden">';
next;
} elsif($tag eq '[quote]') {
push @open, 'quote';
@@ -89,7 +89,7 @@ sub bb2html {
$rmnewline = 1;
next;
} elsif($tag eq '[/spoiler]' && $open[$#open] eq 'spoiler') {
- $result .= '</b>';
+ $result .= !$charspoil ? '</b>' : '</span>';
pop @open;
next;
} elsif($tag eq '[/quote]' && $open[$#open] eq 'quote') {