Skip Menu |

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

Report information
The Basics
Id: 16706
Status: open
Priority: 0/
Queue: Syntax-Highlight-Shell

People
Owner: Nobody in particular
Requestors: burak [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Perl::Tidy css compatibility?
I've created a patch for Perl::Tidy compatibility. Basically it first caches the original values and then alters the %classes hash. Users can disable/enable it anytime they want.
149a150,200 > =item tidy_compat() > > If called with a true value, enabled C<Perl::Tidy> compatibility > mode and the resulting html will have C<Perl::Tidy> css classes. > This method must be called before L</parse()>. > > B<Examples> > > $highlighter->tidy_compat(1); > $html = $highlighter->parse(q{ echo "hello world" }); > # you can disable compatibilitiy afterwards > $highlighter->tidy_compat(0); > $html = $highlighter->parse(q{ echo "hello world" }); > > See L<Perl::Tidy> for more information. > > =cut > > my(%tidy_map, %classes_orig); > my $tidy_state = 0; # active/passive? > sub tidy_compat { > my $self = shift; > my $bool = shift; > return unless defined $bool; > if ($bool) { > unless (%tidy_map && %classes_orig) { # initialize cache > %tidy_map = qw( > s-key k > s-blt m > s-cmd w > s-arg l > s-mta pu > s-quo q > s-var v > s-avr s > s-val hh > s-cmt c > s-lno n > ); > %classes_orig = (%classes); > } > foreach my $k (keys %classes) { > $classes{$k} = $tidy_map{$classes{$k}} || $classes{$k}; > } > $tidy_state = 1; > } else { > %classes = (%classes_orig); > $tidy_state = 0; > } > } >
Date: Sat, 31 Dec 2005 15:20:33 +0100
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
To: bug-Syntax-Highlight-Shell [...] rt.cpan.org
Subject: Re: [cpan #16706] Perl::Tidy css compatibility?
RT-Send-Cc:
Show quoted text
> I've created a patch for Perl::Tidy compatibility. Basically it first caches > the original values and then alters the %classes hash. Users can > disable/enable it anytime they want.
Hello, Sorry for not answering earlier, but your mail arrived just after I left for Christmas with my family, where I didn't have connection. Thanks for your patch, I'll take a look at it. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.