… | |
… | |
266 | my ($self, $row) = @_; |
266 | my ($self, $row) = @_; |
267 | |
267 | |
268 | # fetch the line that has changed |
268 | # fetch the line that has changed |
269 | my $line = $self->line ($row); |
269 | my $line = $self->line ($row); |
270 | my $text = $line->t; |
270 | my $text = $line->t; |
|
|
271 | my $rend; |
271 | |
272 | |
272 | # find all urls (if any) |
273 | # find all urls (if any) |
273 | for my $matcher (@{$self->{matchers}}) { |
274 | for my $matcher (@{$self->{matchers}}) { |
274 | while ($text =~ /$matcher->[0]/g) { |
275 | while ($text =~ /$matcher->[0]/g) { |
275 | #print "$&\n"; |
276 | #print "$&\n"; |
276 | my $rend = $line->r; |
277 | $rend ||= $line->r; |
277 | |
278 | |
278 | # mark all characters as underlined. we _must_ not toggle underline, |
279 | # mark all characters as underlined. we _must_ not toggle underline, |
279 | # as we might get called on an already-marked url. |
280 | # as we might get called on an already-marked url. |
280 | &{$matcher->[2]} |
281 | &{$matcher->[2]} |
281 | for @{$rend}[$-[0] .. $+[0] - 1]; |
282 | for @{$rend}[$-[0] .. $+[0] - 1]; |
282 | |
|
|
283 | $line->r ($rend); |
|
|
284 | } |
283 | } |
285 | } |
284 | } |
|
|
285 | |
|
|
286 | $line->r ($rend) if $rend; |
286 | |
287 | |
287 | () |
288 | () |
288 | } |
289 | } |
289 | |
290 | |
290 | sub valid_button { |
291 | sub valid_button { |