Module:Item: Difference between revisions

Removed mobile specific classes and unused parameters. Standardizing parameter naming convention to snake_case
Tags: Mobile edit Mobile web edit
mNo edit summary
Line 1: Line 1:
-- Adapted from: https://genshin-impact.fandom.com/wiki/Module:Item
local p = {}
local p = {}
local lib = require('Module:Feature')
local lib = require('Module:Feature')
Line 88: Line 90:
function addPunct(var)
function addPunct(var)
if args.comma or args.commaspc then var = var .. ','
if args.comma or args.comma_spc then var = var .. ','
elseif args.dot or args.dotspc then var = var .. '.'
elseif args.dot or args.dot_spc then var = var .. '.'
end
end
var = var
var = var
Line 103: Line 105:
end
end
if args.commaspc or args.dotspc then b = b .. ' ' end -- space always on the very end
if args.comma_spc or args.dot_spc then b = b .. ' ' end -- space always on the very end
return {a, b}
return {a, b}
Line 138: Line 140:
if (ref) then
if (ref) then
local after = (args.commaspc or args.dotspc) and ' ' or '' -- avoid space between ref and punctuation  
local after = (args.comma_spc or args.dot_spc) and ' ' or '' -- avoid space between ref and punctuation  
item_text:wikitext(ref, after)
item_text:wikitext(ref, after)
end
end