Content deleted Content added
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 {},
article_whitelist = global_article_whitelist or {},
template_list = global_template_list or {},
citeref_patterns = citeref_patterns_make() or {}
template_name_get = template_name_get -- for debugging
}
|