Parse db tag field with CSV parser module

The CSV parser module is being used in another
template. Make tag field parsing consistent.
This commit is contained in:
Roan Horning 2024-09-17 22:58:54 -04:00
parent 31a5994731
commit 70d5983ede
Signed by: rho_n
GPG Key ID: 234AEF20B72D5769

View File

@ -5,12 +5,10 @@
$Template::Stash::PRIVATE = undef; # Allow . in tag
<!--% END %-->
<!--% uniq_tag_count = 0 %-->
<!--% comma_re = '(?x)(?:^|,\s*)(?:"((?>[^"]*)(?:""[^"]*)*)"|([^",]*))'; %-->
<!--# 'Moka5,interview, "computer science"' -->
<!--% FOREACH episode IN DBI.query(query_tags);
ep_id = episode.id;
ep_tags = episode.tags;
FOREACH tag_str IN ep_tags.split(comma_re);
FOREACH tag_str IN ep_tags.csv_parse;
NEXT UNLESS tag_str;
NEXT IF tag_str == '';
tag = tag_str.lower;