I can't escape afterwards, because that will fuck up the inserted markup.
that is why I unescape the link inside the callback.


On Thu, Jan 2, 2014 at 10:27 AM, Jan Henning Thorsen <
notifications@github.com> wrote:

> In lib/Convos/Plugin/Helpers.pm:
>
> > @@ -75,17 +76,12 @@ sub _parse_message {
> >    $message->{message} =~ s/\x03\d{0,15}(,\d{0,15})?//g;
> >    $message->{message} =~ s/[\x00-\x1f]//g;
> >
> > -  while($message->{message} =~ m!($URL_RE)!g) {
> > -    my $url = $1;
> > -    my $now = pos $message->{message};
> > -
> > -    push @chunks, Mojo::Util::xml_escape(substr $message->{message}, $last, $now - length($url) - $last);
> > -    push @chunks, $c->link_to($url, $url, target => '_blank');
> > -    $last = $now;
> > -  }
> > -
> > -  push @chunks, Mojo::Util::xml_escape(substr $message->{message}, $last);
> > -  return join '', @chunks;
> > +  my $finder=URI::Find->new(sub {
> > +      my $url=Mojo::Util::html_unescape(shift.'');
> > +      $c->link_to($url, $url, target => '_blank'); });
> > +  my $msg=Mojo::Util::xml_escape($message->{message});
>
> Are you sure you want to xml_escape() before finding the URL?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Nordaaker/convos/pull/44/files#r8609498>
> .
>



-- 
---
Marcus Ramberg
Chief Yak Shaver
Nordaaker Consulting
+47-93417508