మాడ్యూల్:Footnotes/anchor id list: కూర్పుల మధ్య తేడాలు
Content deleted Content added
దిద్దుబాటు సారాంశం లేదు |
sync from sandbox; |
||
పంక్తి 463:
local anchor_id; -- the assembled anchor id from this template
local date;
local name_default;
local date_default;
local vol;
local params = {}; -- table of template parameters
Line 471 ⟶ 474:
date = date_get (template, alias_patterns_date); -- get date; done here because might be in {{date}}
-- date = whitelist.wrapper_templates[template_name][2] or ''; -- no externally visible date so get default date
ref = template:match ('|%s*ref%s*=%s*(%b{})'); -- first look for |ref={{sfnref}} or |ref={{harvid}} because we will strip templates from the wrapper template
Line 489 ⟶ 492:
template_params_get (template, params); -- build a table of template parameters and their values
if whitelist.wrapper_templates[template_name][1] then -- is this wrapper a simple-default wrapper?
name_default = whitelist.wrapper_templates[template_name][1]; -- get the default names
date_default = whitelist.wrapper_templates[template_name][2]; -- get the default date
else
vol = params['volume'] or 'default';
if not whitelist.wrapper_templates[template_name][vol] then -- make sure this volume exists
vol = 'default'; -- doesn't exist, use default volume
end
name_default = whitelist.wrapper_templates[template_name][vol][1]; -- get the default names
date_default = whitelist.wrapper_templates[template_name][vol][2]; -- get the default date
end
if 'harv' == ref or not ref then -- |ref=harv specified or |ref= missing or empty
Line 496 ⟶ 511:
names_get (params, aliases_editor) or
vnames_get (params, 'veditors') or -- |veditors=
-- whitelist.wrapper_templates[template_name][1]; -- default names from whitelist
if '' == date then -- if date not provided in the template
date = date_default; -- use the default date from whitelist
end
if anchor_id then -- if names were gotten
|