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

Content deleted Content added
m typos
Tag: Reverted
Restored revision 1269309666 by Hike395 (talk): Rv debugging
Line 750:
 
if data.known_templates_cs12 [template_name] then
mw.log(template_name..' is cs12')
anchor_id = anchor_id_make_cs12 (template); -- extract an anchor id from this template
list_add (anchor_id, anchor_id_list, true)
 
elseif data.known_templates_vcite [template_name] then
mw.log(template_name..' is vcite')
local ref = template:match ('|%s*ref%s*=%s*(%b{})'); -- first look for |ref={{sfnref}} or |ref={{harvid}} because we will strip templates from the vcite template
if ref then -- |ref={{template}}
Line 773 ⟶ 771:
 
elseif data.known_templates_harvc [template_name] then
mw.log(template_name..' is harvc')
anchor_id = anchor_id_make_harvc (template); -- extract an anchor id from this template
list_add (anchor_id, anchor_id_list, true);
elseif data.known_templates_wikicite [template_name] then
mw.log(template_name..' is wikicite')
local ref = template:match ('|%s*ref%s*=%s*(%b{})'); -- first look for |ref={{sfnref}} or |ref={{harvid}}
Line 803 ⟶ 799:
 
elseif data.known_templates_anchor [template_name] then
mw.log(template_name..' is known anchor')
anchor_id_make_anchor (template, anchor_id_list); -- extract anchor ids from this template if any
elseif data.known_templates_sfn_whitelist [template_name] then
mw.log(template_name..' is known sfn_whitelist')
template = template:gsub ('^{{[^|]+|', ''):gsub ('}}$', '', 1); -- remove outer {{ and }} and template name
template = mw.text.trim (template, '%s|'); -- trim leading trailing white space and pipes
Line 820 ⟶ 814:
 
elseif template_name and whitelist.wrapper_templates[template_name] then
mw.log(template_name..' is a wrapper')
anchor_id = anchor_id_make_wrapper (template); -- extract an anchor id from this template if possible
list_add (anchor_id, anchor_id_list, true);
Line 826 ⟶ 819:
elseif template_name and template_name:match ('^Cit[ea]') then -- not known, not known wrapper; last gasp, try as cs1-like
mw.log(template_name..' is cs1-like')
anchor_id = anchor_id_make_cs12 (template); -- extract an anchor id from this template if possible
list_add (anchor_id, anchor_id_list, true);
Line 873 ⟶ 865:
--[[--------------------------< E X P O R T E D _ T A B L E S >------------------------------------------------
]]
 
mw.log('Calling sandbox anchor_id_list')
 
-- First create global_anchor_id_list, global_template_list, global_article_whitelist