Module:Footnotes/anchor id list/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 12:
}
local redirects_patent = { -- special case cs1-like templates because uses different parameters for name and date in anchor ID
['citeCite patent'] = true,
['citerefCiteref patent'] = true,
['refRef patent'] = true,
}
local redirects_sfnref = {
Line 87:
'<source.->.-</source>', -- deprecated alias of syntaxhighlight tag
}
local template_skip = { -- TODO: necessarytemplates to keepbe this?skipped withfor knownwhatever templatereason; tablesmostly templatesbecause notthey inresemble thosecs1-like tables will be skippedtemplates
['citationCitation-attribution'] = true,
}
local Article_content;
Line 383:
return nil; -- could not get template name from (possibly corrupt) template; extraneous opening { mid template can cause this;
end;
template_name = template_name:gsub ('%s*$', ''); -- trim trailing whitespace; leading whitespace already removed
return Lang_obj:ucfirst (template_name); -- first character in template name must be uppercase (same as canonical template name) TODO: better way to do this?
end
Line 465:
local params = {}; -- table of template parameters
template_name = template_name_get (template); -- get first char uppercase trimmed template name as written; ignore subpages ~/new, ~/sandbox
if not template_name or template_skip[template_name] then
return nil; -- could not extract template name from (possibly corrupted) template (extraneous opening { in the template will cause this)
Line 505:
anchor_id = sfnref_get (ref); -- returns content of {{sfnref}} or {{harvid}}; nil else
 
elseif 'none' == ref and not redirects_patent[template_name] then -- |ref=none; not supported by cite patent
return nil; -- anchor id expicitly suppressed
Line 537:
local params = {}; -- table of template parameters
template_name = template_name_get (template); -- get lowercasefirst char uppercase trimmed template name; ignore subpages ~/new, ~/sandbox
if not template_name or template_skip[template_name] then
return nil; -- could not extract template name from (possibly corrupted) template (extraneous opening { in the template will cause this)
Line 711:
end
 
template_name = template_name_get (template); -- get first char uppercase trimmed template name; ignore subpages ~/new, ~/sandbox
template_list_add (template); -- add this template's name to the list