15.082
Bearbeitungen
Keine Bearbeitungszusammenfassung |
(isEmpty() Tabellencheck) |
||
| (9 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
local p = {} | local p = {} | ||
function p. | function p.attributeTable(args) | ||
-- Draws a simple Table that contains all arguments that are fed from the | -- Draws a simple Table that contains all arguments that are fed from the | ||
-- template to the scribunto-model. For debugging only! | -- template to the scribunto-model. For debugging only! | ||
| Zeile 90: | Zeile 90: | ||
function p.isEmpty(a) | function p.isEmpty(a) | ||
return a == '' or a == nil | if type(a) == "table" then | ||
for _ in pairs(a) do | |||
return false | |||
end | |||
return true | |||
else | |||
return a == '' or a == nil | |||
end | |||
end | end | ||
| Zeile 204: | Zeile 211: | ||
end | end | ||
function p. | function p.TemplateTranscludeWithArgs(frame) | ||
local args = p.shallowcopy(frame:getParent().args) -- frame:getParent().args als Basis nehmen | local args = p.shallowcopy(frame:getParent().args) -- frame:getParent().args als Basis nehmen | ||
local template = frame.args[1] -- enthält Vorlagen-Seitenname | local template = frame.args[1] -- enthält Vorlagen-Seitenname | ||
| Zeile 231: | Zeile 238: | ||
end | end | ||
return result | return result | ||
end | |||
function p.returnStringCheck(s) | |||
local t = "" | |||
local l = string.len(s) | |||
mw.smw.set({["LuaReturnLength"] = l}) | |||
if l > 100000 then -- aktuell Fehler ab ca. 450.000 | |||
t = t .. "[[Kategorie:Lua-String-Länge problematisch]]" | |||
end | |||
return t | |||
end | end | ||
return p | return p | ||