Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

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)

Attachments


MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Subject: Perl::Tidy css compatibility?
Content-Type: multipart/mixed; boundary="----------=_1135364827-31235-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 179
Download (untitled) / with headers
text/plain 179b
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.
Content-Type: application/octet-stream; name="Shell.pm.diff"
Content-Disposition: inline; filename="Shell.pm.diff"
Content-Transfer-Encoding: base64
Content-Length: 1869
Download Shell.pm.diff
text/x-diff 1.8k
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; > } > } >
Return-Path: <maddingue [...] free.fr>
X-Original-To: bug-Syntax-Highlight-Shell [...] rt.cpan.org
Delivered-To: cpan-bug+syntax-highlight-shell [...] diesel.bestpractical.com
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 142644D8233 for <bug-Syntax-Highlight-Shell [...] rt.cpan.org>; Sat, 31 Dec 2005 09:21:08 -0500 (EST)
Received: (qmail 16841 invoked by alias); 31 Dec 2005 14:20:40 -0000
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
X-Spam-Check-BY: la.mx.develooper.com
Received-SPF: pass (x1.develooper.com: local policy)
Received: from smtp1-g19.free.fr (HELO smtp1-g19.free.fr) (212.27.42.27) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 31 Dec 2005 06:20:37 -0800
Received: from imp1-g19.free.fr (imp1-g19.free.fr [212.27.42.1]) by smtp1-g19.free.fr (Postfix) with ESMTP id B37696E4BE for <bug-Syntax-Highlight-Shell [...] rt.cpan.org>; Sat, 31 Dec 2005 15:20:33 +0100 (CET)
Received: by imp1-g19.free.fr (Postfix, from userid 33) id 9D9EDD1C08; Sat, 31 Dec 2005 15:20:33 +0100 (MET)
Received: from jua06-1-82-242-157-236.fbx.proxad.net (jua06-1-82-242-157-236.fbx.proxad.net [82.242.157.236]) by imp1-g19.free.fr (IMP) with HTTP for <maddingue [...] imap.free.fr>; Sat, 31 Dec 2005 15:20:33 +0100
Message-Id: <1136038833.43b693b189662 [...] imp1-g19.free.fr>
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?
References: <rt-16706-50005.13.6956087389034 [...] cpan.org>
In-Reply-To: <rt-16706-50005.13.6956087389034 [...] cpan.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 3.2.5
X-Originating-Ip: 82.242.157.236
RT-Send-Cc:
X-RT-Original-Encoding: iso-8859-1
Content-Length: 443
Download (untitled) / with headers
text/plain 443b
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.


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.