use Encode qw( decode_utf8 );
sub Alert {
- my ($title, $debug) = @_;
- $title .= ": <em>$debug</em>" if $Dev and defined $debug;
- say "<p class=error>$title</p>\n";
+ my ($html, $debug) = @_;
+ ref $html eq 'ARRAY' or $html = [$html];
+ my ($title, @lines) = @{$html};
+ $body = "<h2>$title</h2>";
+ $body .= "\n<p>$_</p>" for @lines;
+ $body .= "\n<pre>$debug</pre>" if $Dev and $debug;
+ say "<div class=error>$body</div>\n";
}
$PLP::ERROR = sub {