Subject: | Inline Pod breaks highlighting |
The latest version of Syntax::Highlight::Engine::Kate::Perl breaks syntax highlighting if there is
embedded POD. All code after the =cut is rendered as "Comment". The following minimal test
case demonstrates the error.
Cheers,
Ovid
#!/usr/bin/env perl
use strict;
use warnings;
use Term::ANSIColor ':constants';
use Syntax::Highlight::Engine::Kate::Perl;
my $highlighter = Syntax::Highlight::Engine::Kate::Perl->new(
format_table => {
'Keyword' => [ GREEN, RESET ],
'Comment' => [ BLUE, RESET ],
'Decimal' => [ YELLOW, RESET ],
'Float' => [ YELLOW, RESET ],
'Function' => [ CYAN, RESET ],
'Identifier' => [ RED, RESET ],
'Normal' => [ MAGENTA, RESET ],
'Operator' => [ CYAN, RESET ],
'Preprocessor' => [ RED, RESET ],
'String' => [ RED, RESET ],
'String Char' => [ RED, RESET ],
'Symbol' => [ CYAN, RESET ],
'DataType' => [ YELLOW, RESET ],
}
);
my $code = <<'CODE';
sub dec {
my $arg = shift;
return $arg--
}
=head1 NAME
=cut
sub inc {
my $arg = shift;
return $arg++;
}
CODE
print $highlighter->highlightText($code);