48,404
edits
No edit summary |
No edit summary |
||
| Line 148: | Line 148: | ||
table.insert(parts, "</span>") | table.insert(parts, "</span>") | ||
return table.concat(parts) | return table.concat(parts) | ||
end | end | ||
| Line 212: | Line 202: | ||
if not expansion then | if not expansion then | ||
return tag | return tag | ||
end | end | ||
return expansion | return expansion | ||
| Line 248: | Line 234: | ||
end | end | ||
tag = expansion | tag = expansion | ||
return tag | return tag | ||
end | end | ||
| Line 287: | Line 267: | ||
local normtags = {} | local normtags = {} | ||
for _, component in ipairs(components) do | for _, component in ipairs(components) do | ||
table.insert(normtags, normalize_single_tag(component, do_track)) | table.insert(normtags, normalize_single_tag(component, do_track)) | ||
end | end | ||
| Line 335: | Line 310: | ||
local normtags = {} | local normtags = {} | ||
for _, single_tag in ipairs(split_tags) do | for _, single_tag in ipairs(split_tags) do | ||
table.insert(normtags, normalize_multipart_component(single_tag, | table.insert(normtags, normalize_multipart_component(single_tag, | ||
recombine_multitags, do_track)) | recombine_multitags, do_track)) | ||
| Line 364: | Line 335: | ||
-- form, i.e. as canonical-form tags joined by "//" and/or ":". | -- form, i.e. as canonical-form tags joined by "//" and/or ":". | ||
function export.normalize_tags(tags, recombine_multitags, do_track) | function export.normalize_tags(tags, recombine_multitags, do_track) | ||
local ntags = {} | local ntags = {} | ||
for _, tag in ipairs(tags) do | for _, tag in ipairs(tags) do | ||
-- Expand the tag, which may generate a new tag (either a | -- Expand the tag, which may generate a new tag (either a | ||
-- fully canonicalized tag, a multipart tag, or a list of tags). | -- fully canonicalized tag, a multipart tag, or a list of tags). | ||
| Line 392: | Line 342: | ||
if type(tag) == "table" then | if type(tag) == "table" then | ||
for _, t in ipairs(tag) do | for _, t in ipairs(tag) do | ||
table.insert(ntags, normalize_tag(t, recombine_multitags, | table.insert(ntags, normalize_tag(t, recombine_multitags, | ||
do_track)) | do_track)) | ||