Skip Menu |
 

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

Report information
The Basics
Id: 16765
Status: open
Priority: 0/
Queue: Syntax-Highlight-HTML

People
Owner: SAPER [...] cpan.org
Requestors: nadine.and.henry [...] pobox.com
Cc:
AdminCc:

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



Subject: data missing inside <script> </script> tags
Download (untitled) / with headers
text/plain 568b
In Syntax-Highlight-HTML-0.04 with perl, v5.8.7 built for i486-linux-gnu-thread-multi (I don't think that matters) and OS: Linux 2.6.14.4 #1 PREEMPT Sat Dec 24 10:17:48 MST 2005 i686 GNU/Linux (I don't think that matters either) If you highlight the following: <script type="text/javascript"> <!-- javascript here //--> </script> The data between the script tags is missing. I tracked this down a bit, and you never see the data from HTML::Parser. It seems to skip whatever is between those tags. I haven't been able to figure out how to disable this behaviour.
Date: Wed, 28 Dec 2005 16:41:18 +0100
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
To: bug-Syntax-Highlight-HTML [...] rt.cpan.org
Subject: Re: [cpan #16765] data missing inside <script> </script> tags
RT-Send-Cc:
I can't reproduce the error you describe: $ cat rt-16765.pl #!/usr/bin/perl use strict; use Syntax::Highlight::HTML; my $highlighter = new Syntax::Highlight::HTML; print $highlighter->parse(<<'HTML'); <script type="text/javascript"> <!-- javascript here //--> </script> HTML $ perl rt-16765.pl <pre> <span class="h-ab">&lt;</span><span class="h-tag">script</span> <span class="h-attr">type</span>=<span class="h-attv">"text/javascript</span>"<span class="h-ab">&gt;</span> <!-- javascript here //--> <span class="h-ab">&lt;/</span><span class="h-tag">script</span><span class="h-ab">&gt;</span> </pre> As you see the text between the <script> tags is still present. Maybe it comes from your version of HTML::Parser (although I doubt it). What version are you using? FWIW, I'm using: This is perl, v5.8.5 built for i386-linux-thread-multi HTML::Parser 3.48 Syntax::Highlight::HTML 0.04 -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: nadine.and.henry [...] pobox.com
Download (untitled) / with headers
text/plain 1.5k
Yes, the text is present, but it isn't highlighted. In other words, it disappears when it is viewed as html (since it is a comment). I have discovered since I wrote the bug report that if you do: my $html_formatter = Syntax::Highlight::HTML->new(0); $html_formatter->xml_mode(1); The the comments DO show up as highlighted html. I hope this is helpful. Best wishes, Henry Laxen [maddingue@free.fr - Wed Dec 28 10:41:54 2005]: Show quoted text
> I can't reproduce the error you describe: > > $ cat rt-16765.pl > #!/usr/bin/perl > use strict; > use Syntax::Highlight::HTML; > > my $highlighter = new Syntax::Highlight::HTML; > print $highlighter->parse(<<'HTML'); > <script type="text/javascript"> > <!-- > javascript here > //--> > </script> > HTML > > $ perl rt-16765.pl > <pre> > <span class="h-ab">&lt;</span><span class="h-tag">script</span> > <span > class="h-attr">type</span>=<span class="h- > attv">"text/javascript</span>"<span > class="h-ab">&gt;</span> > <!-- > javascript here > //--> > <span class="h-ab">&lt;/</span><span class="h- > tag">script</span><span > class="h-ab">&gt;</span> > </pre> > > As you see the text between the <script> tags is still present. > Maybe it comes from your version of HTML::Parser (although I doubt > it). > What version are you using? > > FWIW, I'm using: > This is perl, v5.8.5 built for i386-linux-thread-multi > HTML::Parser 3.48 > Syntax::Highlight::HTML 0.04 > > -- > Sébastien Aperghis-Tramoni > > Close the world, txEn eht nepO.
Date: Fri, 30 Dec 2005 15:19:34 +0100
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
To: bug-Syntax-Highlight-HTML [...] rt.cpan.org
Subject: Re: [cpan #16765] data missing inside <script> </script> tags
RT-Send-Cc:
Download (untitled) / with headers
text/plain 605b
You wrote: Show quoted text
> Yes, the text is present, but it isn't highlighted. In other words, it > disappears when it is viewed as html (since it is a comment).
D'oh! Stoopid me :) Show quoted text
> I have discovered since I wrote the bug report that if you do: > > my $html_formatter = Syntax::Highlight::HTML->new(0); > $html_formatter->xml_mode(1); > > The the comments DO show up as highlighted html. > I hope this is helpful.
Strange, I didn't need this option previously. I'll have to make more tests. Maybe you just found a corner case in HTML::Parser. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.