Modul:Citation/utilities: Unterschied zwischen den Versionen
code check
(replace character references and entities) |
(code check) |
||
| Zeile 3: | Zeile 3: | ||
suite = 'Citation', | suite = 'Citation', | ||
sub = 'utilities', | sub = 'utilities', | ||
serial = '2020- | serial = '2020-05-16', | ||
} | } | ||
| Zeile 45: | Zeile 45: | ||
-- make complete message from message array | -- make complete message from message array | ||
function cu.getErrorMsgs() | function cu.getErrorMsgs() | ||
-- remove duplicates | -- remove duplicates | ||
for i = #errorMsgs, 1, -1 do | for i = #errorMsgs, 1, -1 do | ||
| Zeile 56: | Zeile 55: | ||
end | end | ||
result = table.concat( errorMsgs, ' ' ) | local result = table.concat( errorMsgs, ' ' ) | ||
if result ~= '' then | if result ~= '' then | ||
result = result .. ' ' | result = result .. ' ' | ||
| Zeile 78: | Zeile 77: | ||
end | end | ||
for index, value in ipairs( tab ) do | for index, value in ipairs( tab ) do | ||
if value == val then | if value == val then | ||
| Zeile 90: | Zeile 88: | ||
-- convert values t from list if translated | -- convert values t from list if translated | ||
function cu.getKey( t, list ) | function cu.getKey( t, list ) | ||
local result = '' | local result = '' | ||
for key, tab in pairs( list ) do | for key, tab in pairs( list ) do | ||
if cu.inArray( tab, t ) then | if cu.inArray( tab, t ) then | ||
| Zeile 163: | Zeile 161: | ||
-- zero-width joiner, zero-width space, soft hyphen | -- zero-width joiner, zero-width space, soft hyphen | ||
-- remove characters: soft hyphen, LTR mark, RTL mark | -- remove characters: soft hyphen, LTR mark, RTL mark | ||
for i, value in ipairs( { '', '', '' } ) do | for i, value in ipairs( { '', '', '' } ) do | ||
| Zeile 207: | Zeile 204: | ||
if aDate ~='' then | if aDate ~='' then | ||
local | local success, t = pcall( formatDate, aDate, aFormat ) | ||
if success then | if success then | ||
return t | return t | ||