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

Content deleted Content added
Restored revision 1269309666 by Hike395 (talk): Rv debugging
handle citation module in template_name_get
Line 386:
local function template_name_get (template)
local template_name = template:match ('^{{%s*([^/|}]+)'); -- get template name; ignore subpages ~/new, ~/sandbox; parser functions
 
if template_name and template_name:match ('^#invoke%s*:') then -- handle directly-invoked citation modules
template_name = template_name:match ('^#invoke%s*:%s*(.+)'); -- get module name
local func_name = template:match ('^{{[^|}]+%|%s*([^/|}]*)'); -- get function name
if template_name and func_name then -- valid module invocation
template_name = template_name:gsub ('%s+$', '') .. ' ' .. func_name;-- ensure exactly one trailing whitespace between module and function name
else
template_name = nil; -- could not get module and function name
end;
end;
 
if not template_name or template_name:match ('^#') then -- parser functions, magic words don't count as templates
Line 871 ⟶ 881:
-- Then stuff them (and derived tables) into return table
return {
anchor_id_list = global_anchor_id_list or {}, -- table of anchor ids available in this article
article_whitelist = global_article_whitelist or {}, -- table of anchor ids with false-positive error message to be suppressed
template_list = global_template_list or {}, -- table of templates used in this article
citeref_patterns = citeref_patterns_make() or {} , -- table of Lua patterns to search for citeref from wrappers
template_name_get = template_name_get -- for debugging
}