From: Michael Andreen Date: Wed, 17 Jan 2007 09:55:37 +0000 (+0000) Subject: output original text, if it can't be parsed X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;h=c9e0c080884b28042ccca193dd91c8d55a3c3855;p=ndwebbie.git output original text, if it can't be parsed --- diff --git a/ND/Web/Include.pm b/ND/Web/Include.pm index 220a781..bdeb350 100644 --- a/ND/Web/Include.pm +++ b/ND/Web/Include.pm @@ -19,7 +19,7 @@ package ND::Web::Include; use strict; -use warnings FATAL => 'all'; +use warnings; use CGI qw{:standard}; require Exporter; use BBCode::Parser; @@ -72,9 +72,11 @@ sub parseMarkup { #$text =~ s{\[PRE\](.*?)\[/PRE\]}{
$1
}sgi; #$1 =~ s{
}{}g; - my $tree = BBCode::Parser->DEFAULT->parse($text); - - return scalar $tree->bodyHTML;; + eval{ + my $tree = BBCode::Parser->DEFAULT->parse($text); + $text = $tree->toHTML; + }; + return $text; }