From 12338003bde24a3a263abe8caca71b1836ecee83 Mon Sep 17 00:00:00 2001 From: morkt <> Date: Mon, 22 Dec 2014 11:49:08 +0100 Subject: bbcode: Replace [vcpgi][0-9]+ links with a [url] tag Patch from https://vndb.org/t5564.13 --- lib/VNDBUtil.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/VNDBUtil.pm') diff --git a/lib/VNDBUtil.pm b/lib/VNDBUtil.pm index c864fda9..e81971a6 100644 --- a/lib/VNDBUtil.pm +++ b/lib/VNDBUtil.pm @@ -116,7 +116,7 @@ sub bb2html { next; } # id - if(($id || $exid || $longid) && (!$result || substr($raw, $last-1-length($match), 1) !~ /[\w]/) && substr($raw, $last, 1) !~ /[\w]/) { + if(($id || $exid || $longid) && !grep(/url/, @open) && (!$result || substr($raw, $last-1-length($match), 1) !~ /[\w]/) && substr($raw, $last, 1) !~ /[\w]/) { (my $lnk = $match) =~ s/^d(\d+)\.(\d+)\.(\d+)$/d$1#$2.$3/; $length += length $lnk; last if $maxlength && $length > $maxlength; -- cgit v1.2.3