76 |
my $self = shift; |
my $self = shift; |
77 |
my $callback = {@_}; |
my $callback = {@_}; |
78 |
|
|
79 |
|
warn "# callbacks: ",$self->dump( $callback ) if $callback; |
80 |
|
|
81 |
my $patt = $self->pattern; |
my $patt = $self->pattern; |
82 |
$self->title( $patt ); |
$self->title( $patt ); |
83 |
|
|
106 |
|
|
107 |
my $text = $result->{text} || die "no text"; |
my $text = $result->{text} || die "no text"; |
108 |
|
|
|
$text = $self->html_escape( $text ); |
|
109 |
if ( my $path = $result->{path} ) { |
if ( my $path = $result->{path} ) { |
110 |
my $line = $result->{line} || die "no line"; |
my $line = $result->{line} || die "no line"; |
111 |
if ( $path ne $last_path ) { |
if ( $path ne $last_path ) { |
114 |
if ( my $dd = $callback->{dd} ) { |
if ( my $dd = $callback->{dd} ) { |
115 |
$html .= $dd->( $patt, $path, $line, $text ); |
$html .= $dd->( $patt, $path, $line, $text ); |
116 |
} else { |
} else { |
117 |
|
$text = $self->html_escape( $text ); |
118 |
$text =~ s{(\Q$patt\E)}{<b>$1</b>}; |
$text =~ s{(\Q$patt\E)}{<b>$1</b>}; |
119 |
$html .= qq|<dd><a target="editor" href="/editor+$path+$line">$line</a> <code>$text</code>|; |
$html .= qq|<dd><a target="editor" href="/editor+$path+$line">$line</a> <code>$text</code>|; |
120 |
} |
} |
121 |
$last_path = $path; |
$last_path = $path; |
122 |
} else { |
} else { |
123 |
|
$text = $self->html_escape( $text ); |
124 |
$html .= qq|<dt>$text</dt>|; |
$html .= qq|<dt>$text</dt>|; |
125 |
} |
} |
126 |
} |
} |