Skip Menu |

This queue is for tickets about the Syntax-Highlight-Engine-Kate CPAN distribution.

Report information
The Basics
Id: 58326
Status: new
Priority: 0/
Queue: Syntax-Highlight-Engine-Kate

People
Owner: Nobody in particular
Requestors: Jeff.Fearn [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.04
  • 0.06
Fixed in: (no value)



Subject: White space being matched in tags in at least XML and Java
Hi, I have an issue where white space is being matched as part of the tag. I've tested XML and Java in 0.04 and 0.06, and all combination produce similar output. e.g. this XML input, which has a trailing space after list-index my $xml = <<EOL; <list-index column="column_name" base="0|1|..."/>; EOL Produces this output: <perl_Keyword>&lt;list-index</perl_Keyword><perl_Others> column=</perl_Others><perl_String>"column_name"</perl_String> <perl_Others> base=</perl_Others><perl_String>"0|1|..."</perl_String><perl_Keyword>/&gt;</perl_Keyword>; Note how the first perl_Others is wrapped across the line, and the second contains all the white space at the start of the line. I only noticed this because the line break in perl_Others makes the XSLT processor blow up, which is a bug I'm trying to track down, but I thought I may as well bring this to your attention since it's "not correct (TM)" :) FYI I am using this module to highlight code as part of a documentation tool chain, http://publican.fedorahosted.org, and I'm pretty happy with it :) We get some pretty complex input for XML and Java examples and in general it all works well, thanks for a great module! I've attached a script with this input and the settings being used when highlighting. Cheers, Jeff.
Subject: kate-test.pl
#!/usr/bin/env perl use strict; use warnings; use Syntax::Highlight::Engine::Kate; ## NOTE: there is trailing space after list-index my $xml = <<EOL; <list-index column="column_name" base="0|1|..."/>; EOL =head2 faulty output <perl_Keyword>&lt;list-index</perl_Keyword><perl_Others> column=</perl_Others><perl_String>"column_name"</perl_String> <perl_Others> base=</perl_Others><perl_String>"0|1|..."</perl_String><perl_Keyword>/&gt;</perl_Keyword>; =cut my $language = 'XML'; my $hl = new Syntax::Highlight::Engine::Kate( substitutions => { "<" => "&lt;", ">" => "&gt;", "&" => "&amp;", }, format_table => { Alert => [ "<perl_Alert>", "</perl_Alert>" ], BaseN => [ "<perl_BaseN>", "</perl_BaseN>" ], BString => [ "<perl_BString>", "</perl_BString>" ], Char => [ "<perl_Char>", "</perl_Char>" ], Comment => [ "<perl_Comment>", "</perl_Comment>" ], DataType => [ "<perl_DataType>", "</perl_DataType>" ], DecVal => [ "<perl_DecVal>", "</perl_DecVal>" ], Error => [ "<perl_Error>", "</perl_Error>" ], Float => [ "<perl_Float>", "</perl_Float>" ], Function => [ "<perl_Function>", "</perl_Function>" ], IString => [ "<perl_IString>", "</perl_IString>" ], Keyword => [ "<perl_Keyword>", "</perl_Keyword>" ], Normal => [ "", "" ], Operator => [ "<perl_Operator>", "</perl_Operator>" ], Others => [ "<perl_Others>", "</perl_Others>" ], RegionMarker => [ "<perl_RegionMarker>", "</perl_RegionMarker>" ], Reserved => [ "<perl_Reserved>", "</perl_Reserved>" ], String => [ "<perl_String>", "</perl_String>" ], Variable => [ "<perl_Variable>", "</perl_Variable>" ], Warning => [ "<perl_Warning>", "</perl_Warning>" ], }, ); my $tmp = $hl->languagePlug($language) || croak("no plugin for $language"); $hl->language($language); my $out_string = $hl->highlightText($xml); print($out_string); exit;