template_name = template_name:gsub ('%s*$', ''); -- trim whitespace
template_name =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?
-- template_name = template_name:lower(); -- and lowercase only
return template_name;
end
Line 706 ⟶ 703:
local anchor_id; -- place to hold an anchor id as it is extracted / decoded
local find_pattern = '%f[{]{{[^{]';
-- local tstart, tend = Article_content:find ('%f[{]{{[^{]'); -- find the first template; do not find template variables: {{{template var|}}}
local tstart, tend = Article_content:find ('{{'find_pattern); -- find the first template; do not find template variables: {{{template var|}}}
while tstart do
Line 789 ⟶ 786:
list_add (anchor_id, anchor_id_list, true);
end
tstart = tend; -- reset the search starting index
-- tstart, tend = Article_content:find ('%f[{]{{[^{]'find_pattern, tstarttend); -- search for another template; begin at end of last search
tstart, tend = Article_content:find ('{{', tstart); -- search for another template