Modul:Citation/utilities: Unterschied zwischen den Versionen
+cu.formatItem
(+cu.makeLink) |
(+cu.formatItem) |
||
| Zeile 203: | Zeile 203: | ||
table.insert( tab, s2 ) | table.insert( tab, s2 ) | ||
end | end | ||
end | |||
end | |||
function cu.formatItem( s, formatStr ) | |||
if cu.isSet( s ) then | |||
if formatStr then | |||
return mw.ustring.format( formatStr, s ) | |||
else | |||
return s | |||
end | |||
else | |||
return '' | |||
end | |||
end | |||
function cu.formatItem2( s1, s2, formatStr ) | |||
if cu.isSet( s1 ) and cu.isSet( s2 ) then | |||
if formatStr then | |||
return mw.ustring.format( formatStr, s1, s2 ) | |||
else | |||
return s1 .. ' ' .. s2 | |||
end | |||
else | |||
return '' | |||
end | end | ||
end | end | ||
return cu | return cu | ||