Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
when vim color highlighting fails, try to continue.
  • Loading branch information
timo committed Feb 18, 2016
1 parent 5282a5d commit 38822ca
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/Pod/Htmlify.pm6
Expand Up @@ -196,11 +196,19 @@ class Website is export {
my $footer = footer-html;
my %*POD2HTML-CALLBACKS = code => sub (:$node, :&default) {
if $vim-colour {
my $v = ::('Text::VimColour').new(
lang => 'perl6',
code => "{$node.contents.join}"
);
return $v.html;
try {
my $v = ::('Text::VimColour').new(
lang => 'perl6',
code => "{$node.contents.join}"
);
return $v.html;
CATCH {
default {
return "<!-- Error while syntax highlighting this piece of code: $!.message() -->\n" ~
"<pre>" ~ $node.contents.join ~ "</pre>";
}
}
}
}
else {
return "<pre>" ~ $node.contents.join ~ "</pre>";
Expand Down

0 comments on commit 38822ca

Please sign in to comment.