Module:Native name/sandbox: Difference between revisions

Content deleted Content added
reduce surface of plainlist to support templatestyles, rewrite end of function
some simplifications
 
(2 intermediate revisions by 2 users not shown)
Line 118:
if args_t.nolink then
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['template']=template}), ')'}));
ifelseif lang_module._is_ietf_tag (args_t[1]) then
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['link'] ='yes', ['template']=template}), ')'}));
else
table.insert (out_t, '(language?)'); -- TODO: any reason to keep this?
if lang_module._is_ietf_tag (args_t[1]) then
table.insert (out_t, table.concat ({'(', lang_module._name_from_tag ({args_t[1], ['link'] ='yes', ['template']=template}), ')'}));
else
table.insert (out_t, '(language?)'); -- TODO: any reason to keep this?
end
end
 
Line 214 ⟶ 212:
if 0 == #list_t then
return (yes_no (args_t.suppress_empty_list_error) and '') or -- return empty string when error suppressed
error_msg (messages_t.empty_list, 'native name list'); -- otherwise error message else
elseif 1 == #list_t then
return table.concat (list_t)[1]; -- return the very short list; TODO: add error?
else
return require ('Module:List').unbulleted (list_t); -- use unbulleted list from module
end
end
Line 270 ⟶ 268:
return table.concat ({value, error_msg (messages_t.malformed_param, 'native name checker')}, ' '); -- no {{lang}} or {{native_name}} template
end
if 1 < count then
ifand not (value:find ('<div class="plainlist *" *>') or not value:find ('</div>$') then -- must be wrapped in 'plainlist' div
and value:find ('</div>$'))
then
return table.concat ({value, error_msg (messages_t.list_markup, 'native name checker')}, ' ');
end
end