From c9e0c080884b28042ccca193dd91c8d55a3c3855 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 17 Jan 2007 09:55:37 +0000 Subject: [PATCH] output original text, if it can't be parsed --- ND/Web/Include.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; } -- 2.39.2