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

Content deleted Content added
log templates as scanned
more logging
Line 390:
template_name = template_name:match ('^#invoke%s*:%s*(.+)'); -- get module name
local func_name = template:match ('^{{[^|}]+%|%s*([^/|}]*)'); -- get function name
mw.logObject(template_name,"module name")
mw.logObject(func_name,"func_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
Line 400 ⟶ 402:
return nil; -- could not get template name from (possibly corrupt) template; extraneous opening { mid template can cause this;
end;
mw.logObject(template_name,"template name")
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?