📄 simplehtmlformatter.pm
字号:
package KinoSearch::Highlight::SimpleHTMLFormatter;use strict;use warnings;use KinoSearch::Util::ToolSet;use base qw( KinoSearch::Highlight::Formatter );BEGIN { __PACKAGE__->init_instance_vars( pre_tag => '<strong>', post_tag => '</strong>', );}sub highlight { my ( $self, $text ) = @_; return "$self->{pre_tag}$text$self->{post_tag}";}1;__END__=head1 NAMEKinoSearch::Highlight::SimpleHTMLFormatter - surround highlight bits with tags=head1 SYNOPSIS my $formatter = KinoSearch::Highlight::SimpleHTMLFormatter->new( pre_tag => '<i>', post_tag => '</i>', ); # returns "<i>foo</i>" my $highlighted = $formatter->highlight("foo"); =head1 DESCRIPTIONThis subclass ofL<KinoSearch::Highlight::Formatter|KinoSearch::Highlight::Formatter>highlights text by surrounding it with HTML "strong" tags.=head1 METHODS=head2 newConstructor. Takes hash-style params. my $formatter = KinoSearch::Highlight::SimpleHTMLFormatter->new( pre_tag => '*', # default: '<strong>' post_tag => '*', # default: '</strong>' );=over=item *B<pre_tag> - a string which will be inserted immediately prior to thehighlightable text, typically to accentuate it. If you don't wanthighlighting, set both C<pre_tag> and C<post_tag> to C<''>.=item *B<post_tag> - a string which will be inserted immediately after thehighlightable text.=back=head1 COPYRIGHTCopyright 2006-2007 Marvin Humphrey=head1 LICENSE, DISCLAIMER, BUGS, etc.See L<KinoSearch|KinoSearch> version 0.163.=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -