summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-03-18 12:24:56 +0100
committerYorhel <git@yorhel.nl>2021-03-23 11:16:22 +0100
commita286672505ee3f6dfd9fb5d62cef460e7807176d (patch)
treefae538cff1f1b6e1e1af67082dc633639fae854c /lib/VNDB
parent7ffe7fa485c49b3d44150ed7b63d9062ae654ac8 (diff)
Traits: Convert to vndbids + add edit history
Much the same as the previous conversion of tags.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/BBCode.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VNDB/BBCode.pm b/lib/VNDB/BBCode.pm
index c3289784..4f7b5503 100644
--- a/lib/VNDB/BBCode.pm
+++ b/lib/VNDB/BBCode.pm
@@ -139,7 +139,7 @@ sub parse {
while($raw =~ m{(?:
\[ \/? (?i: b|i|u|s|spoiler|quote|code|url|raw ) [^\s\]]* \] | # tag
d[1-9][0-9]* \# [1-9][0-9]* (?: \.[1-9][0-9]* )? | # d+#+[.+]
- [tdvprcswg][1-9][0-9]*\.[1-9][0-9]* | # v+.+
+ [tdvprcswgi][1-9][0-9]*\.[1-9][0-9]* | # v+.+
[tdvprcsugiw][1-9][0-9]* | # v+
(?:https?|ftp)://[^><"\n\s\]\[]+[\d\w=/-] # link
)}xg) {
@@ -295,7 +295,7 @@ sub bb_subst_links {
my %lookup;
parse $msg, sub {
my($code, $tag) = @_;
- $lookup{$2}{ $2 eq 'i' ? $3 : $1 } = 1 if $tag eq 'dblink' && $code =~ /^((.)(\d+))/;
+ $lookup{$2}{$1} = 1 if $tag eq 'dblink' && $code =~ /^((.)\d+)/;
1;
};
return $msg unless %lookup;
@@ -306,7 +306,7 @@ sub bb_subst_links {
c => 'SELECT id, name FROM chars WHERE id IN',
p => 'SELECT id, name FROM producers WHERE id IN',
g => 'SELECT id, name FROM tags WHERE id IN',
- i => 'SELECT \'i\'||id AS id, name FROM traits WHERE id IN',
+ i => 'SELECT id, name FROM traits WHERE id IN',
s => 'SELECT s.id, sa.name FROM staff_alias sa JOIN staff s ON s.aid = sa.aid WHERE s.id IN',
};
my %links;