summaryrefslogtreecommitdiff
path: root/lib/VNDBUtil.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-01-28 13:00:18 +0100
committerYorhel <git@yorhel.nl>2015-01-28 13:00:18 +0100
commit98e6d1a8eb593007d34175b273d23d0fb8fff622 (patch)
treedbc3d94adb740eefdce870452dad981c74e79c6a /lib/VNDBUtil.pm
parentc6fb63e28063e85d2c71fc69200f3d480de0b9c4 (diff)
parentb718d117282e73c3f99d308efde46d56789cd041 (diff)
Merge branch 'staff' into master
Conflicts: lib/VNDB/DB/VN.pm lib/VNDB/Handler/VNPage.pm
Diffstat (limited to 'lib/VNDBUtil.pm')
-rw-r--r--lib/VNDBUtil.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VNDBUtil.pm b/lib/VNDBUtil.pm
index 82da52e6..7bec05b2 100644
--- a/lib/VNDBUtil.pm
+++ b/lib/VNDBUtil.pm
@@ -27,6 +27,9 @@ sub shorten {
# [code] .. [/code]
# v+, v+.+
# http://../
+# XXX: Make sure to sync any changes in the formating with
+# VNDB::Util::Misc::bbSubstLinks() if necessary. Or, alternatively, abstract
+# parsing into a separate function as per http://beta.vndb.org/t5564.12
sub bb2html {
my($raw, $maxlength, $charspoil) = @_;
$raw =~ s/\r//g;
@@ -116,7 +119,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;