From a8a97a6a0bcb4ff36804b79280ba5c9263fe233b Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 24 Aug 2020 16:41:20 +0200 Subject: reviews: Get rid of summary field & split mini/full reviews Much to my disappointment, people don't write proper summaries and, as such, summaries are not useful to be considered a "short review" on their own right. This necessitates splitting the reviews onto different pages. --- lib/VNDB/BBCode.pm | 14 +++++++------- lib/VNDB/Handler/Misc.pm | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/VNDB') diff --git a/lib/VNDB/BBCode.pm b/lib/VNDB/BBCode.pm index f6ab93d9..fe3a43d7 100644 --- a/lib/VNDB/BBCode.pm +++ b/lib/VNDB/BBCode.pm @@ -179,7 +179,7 @@ FINAL: # 2: Just output 'hidden by spoiler setting' message # 3: Just output the spoilers, unmarked sub bb2html { - my($input, $maxlength, $charspoil) = @_; + my($input, $maxlength, $charspoil, $nobreak) = @_; my $incode = 0; my $rmnewline = 0; @@ -202,8 +202,8 @@ sub bb2html { s/&/&/g; s/>/>/g; s//g if !$maxlength; - s/\n/ /g if $maxlength; + s/\n/
/g if !$nobreak; + s/\n/ /g if $nobreak; $_; }; @@ -233,18 +233,18 @@ sub bb2html { $charspoil == 2 ? '-->' : ''; } elsif($tag eq 'quote_start') { - $ret .= '
' if !$maxlength; + $ret .= '
' if !$nobreak; $rmnewline = 1; } elsif($tag eq 'quote_end') { - $ret .= '
' if !$maxlength; + $ret .= '
' if !$nobreak; $rmnewline = 1; } elsif($tag eq 'code_start') { - $ret .= '
' if !$maxlength;
+      $ret .= '
' if !$nobreak;
       $rmnewline = 1;
       $incode = 1;
     } elsif($tag eq 'code_end') {
-      $ret .= '
' if !$maxlength; + $ret .= '
' if !$nobreak; $rmnewline = 1; $incode = 0; diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm index c316999d..b4827da2 100644 --- a/lib/VNDB/Handler/Misc.pm +++ b/lib/VNDB/Handler/Misc.pm @@ -105,7 +105,7 @@ sub homepage { a href => "/$_->{id}", $_->{title}; end; p; - lit bb2html $post->{msg}, 150; + lit bb2html $post->{msg}, 150, 0, 1; end; } end 'td'; -- cgit v1.2.3