]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Include.pm
output original text, if it can't be parsed
[ndwebbie.git] / ND / Web / Include.pm
index 220a7819a6b772beb7ffaeeded7fb7f04032fe4e..bdeb350f58a7f8a48945226a84fe8a0f49c48995 100644 (file)
@@ -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\]}{<pre>$1</pre>}sgi;
        #$1 =~ s{<br/>}{}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;
 }