Module:Citation/CS1: Difference between revisions
remove Module:Wikitext requirement no longer used here, and remove parts of createTag no longer needed
m>Dragons flight (All the functions not directly associated with {cite} moved to Module:Citation) |
m>Dragons flight (remove Module:Wikitext requirement no longer used here, and remove parts of createTag no longer needed) |
||
Line 5: | Line 5: | ||
--require "mw.text" | --require "mw.text" | ||
local z = { | local z = {} | ||
} | |||
function hideinprint(content) | function hideinprint(content) | ||
Line 52: | Line 32: | ||
local content = t.contents or "" | local content = t.contents or "" | ||
local attrs = {} | local attrs = {} | ||
for n,v in pairs(t.params) do | |||
if (v) then | |||
table.insert(attrs, n .. "=\"" .. wikiescape(v) .. "\"") | |||
else | else | ||
table.insert(attrs, n) | |||
end | end | ||
end | |||
if ("" == content) then | |||
return "<" .. name .. " " .. table.concat(attrs, " ") .. "/>" | |||
else | |||
return "<" .. name .. " " .. table.concat(attrs, " ") .. ">" .. content .. "</" .. name .. ">" | |||
end | end | ||
end | end |