summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/BBCode.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/BBCode.pm b/lib/VNDB/BBCode.pm
index 95a90d16..b95ef760 100644
--- a/lib/VNDB/BBCode.pm
+++ b/lib/VNDB/BBCode.pm
@@ -118,8 +118,8 @@ sub parse {
(?:https?|ftp)://[^><"\n\s\]\[]+[\d\w=/-] # link
)}xg) {
my $token = $&;
- my $pre = substr $raw, $last, (pos($raw)-length($&))-$last;
- my $char_pre = $last ? substr $raw, pos($raw)-length($&)-1, 1 : '';
+ my $pre = substr $raw, $last, $-[0]-$last;
+ my $char_pre = $-[0] ? substr $raw, $-[0]-1, 1 : '';
$last = pos $raw;
my $char_post = substr $raw, $last, 1;