diff options
author | Eric Wong <e@yhbt.net> | 2020-04-01 06:16:20 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-04-02 10:27:45 +0000 |
commit | 906393b801050e303d2ec2a660c85de4a5fa4740 (patch) | |
tree | 4fcd132c77cd8eecd09eb2007ecfaa252f48e031 /lib/PublicInbox/Linkify.pm | |
parent | eaa56562a0a09d9e8ecf3f2371dda20645bd82f3 (diff) | |
download | public-inbox-906393b801050e303d2ec2a660c85de4a5fa4740.tar.gz |
This allows us to consistently enforce the same Message-ID extraction rules everywhere and makes it easier for us to make changes in the future. Update scripts/ssoma-replay, as well, but don't rely on PublicInbox::* modules in that since it's legacy and public-inbox was never a dependency of ssoma.
Diffstat (limited to 'lib/PublicInbox/Linkify.pm')
-rw-r--r-- | lib/PublicInbox/Linkify.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Linkify.pm b/lib/PublicInbox/Linkify.pm index 2bd8f64a..b85bedfe 100644 --- a/lib/PublicInbox/Linkify.pm +++ b/lib/PublicInbox/Linkify.pm @@ -14,6 +14,7 @@ use strict; use warnings; use Digest::SHA qw/sha1_hex/; use PublicInbox::Hval qw(ascii_html mid_href); +use PublicInbox::MID qw($MID_EXTRACT); my $SALT = rand; my $LINK_RE = qr{([\('!])?\b((?:ftps?|https?|nntps?|gopher):// @@ -93,7 +94,7 @@ sub linkify_2 { # with $pfx being the URL prefix sub linkify_mids { my ($self, $pfx, $str, $raw) = @_; - $$str =~ s!<([^>]+)>! + $$str =~ s!$MID_EXTRACT! my $mid = $1; my $html = ascii_html($mid); my $href = mid_href($mid); |