logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Description

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

License, Disclaimer, Bugs, Etc.

       See KinoSearch1 version 1.01.

perl v5.40.0                                       2024-10-20              KinoSearch1::H...leHTMLFormatter(3pm)

Methods

new
       Constructor.  Takes hash-style params.

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

       •   pre_tag  -  a string which will be inserted immediately prior to the highlightable text, typically to
           accentuate it.  If you don't want highlighting, set both "pre_tag" and "post_tag" to ''.

       •   post_tag - a string which will be inserted immediately after the highlightable text.

Name

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

Synopsis

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

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

See Also