Skip to main content.
home | support | download

Back to List Archive

Re: SWISH::HiLiter feature request

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Wed Jul 06 2005 - 18:58:27 GMT
You will want to read the perldoc for HTML::HiLiter which is what SWISH::HiLiter 
interfaces to. I think you can set some package vars in HTML::HiLiter to do 
exactly what you describe. The default tag is <span> but you can change that; 
likewise you can change the default class name. It automatically rotates class 
names like 'hilite1' 'hilite2' etc, up to the number of colors you have 
declared, so you could just declare one color and define 'hilite1' in your 
stylesheet.

You might want to skip SWISH::HiLiter altogether and just use HTML::HiLiter, 
depending on your application.

Michael Peters scribbled on 7/6/05 9:51 AM:

> First off, let me thank Peter for implementing this and just saving me
> from doing myself. I do however have one need that is not addressed:
> 
> I would like to be able to specify the starting and ending strings used
> to wrap highlight phrases. Specifically so that my designers can just
> use a 'class' attribute and then control the color/appearance through
> style sheets. If no strings are provided then it can just default back
> to using 'colors', or even have 'colors' override what's in
> 'start_text'/'stop_text'. Either way would be fine for me.
> 
> Something like this:
> 
> my $hiliter = SWISH::HiLiter->new(
>   start_text => '<div class="hilited">',
>   stop_text  => '</div>'
> );
> 
> 

-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
Received on Wed Jul 6 11:58:32 2005