Marvin Humphrey > KinoSearch > KinoSearch::Highlight::SimpleHTMLFormatter

Download:
KinoSearch-0.165.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  7
View Bugs
Report a bug
Source  

NAME ^

KinoSearch::Highlight::SimpleHTMLFormatter - surround highlight bits with tags

SYNOPSIS ^

    my $formatter = KinoSearch::Highlight::SimpleHTMLFormatter->new(
        pre_tag  => '<i>',
        post_tag => '</i>',
    );

    # returns "<i>foo</i>"
    my $highlighted = $formatter->highlight("foo");

DESCRIPTION ^

This subclass of KinoSearch::Highlight::Formatter highlights text by surrounding it with HTML "strong" tags.

METHODS ^

new

Constructor. Takes hash-style params.

    my $formatter = KinoSearch::Highlight::SimpleHTMLFormatter->new(
        pre_tag =>  '*', # default: '<strong>'
        post_tag => '*', # default: '</strong>'
    );

COPYRIGHT ^

Copyright 2006-2009 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc. ^

See KinoSearch version 0.165.