Module:Text

local p = {} local rtable = require( 'Module:Table' )

function p.itemTest( f ) local args = rtable.trimAll( rtable.getArgs( f ) ) local exceptions = { ["Ace of Spades 2"] = "Ace of Spades (Card)", ["Cancer 2"] = "Cancer (Trinket)", ["Gemini"] = "Gemini (Item)", ["Little Horn"] = "Little Horn (Item)", ["Money Power"] = "Money = Power", ["Steven"] = "Steven (Item)" }	for i, j in pairs( exceptions ) do		if args[1] == i then return j		end end return args[1] end function p.itemTest2( f ) local args = rtable.trimAll( rtable.getArgs( f ) ) local exceptions = { ["Ace of Spades 2"] = "Ace of Spades (Card)", ["Cancer 2"] = "Cancer (Trinket)", ["Gemini"] = "Gemini (Item)", ["Little Horn"] = "Little Horn (Item)", ["Money Power"] = "Money = Power", ["Steven"] = "Steven (Item)" }	local name = args[1] for i, j in pairs( exceptions ) do		if args[1] == i then name = j		end end local mode = args[2] == 'a' and 'link-a' or args[2] == 'a+' and 'link-a+' or args[2] == 'n' and 'link-a+' or args[2] or 'link' return f:expandTemplate{ title = ':' .. name, args = { 'itemα' .. name .. 'β' .. mode } } end

p.specialCharacters = { ['"'] = "oquote",	["“"] = "oquote",	["”"] = "cquote",	["*"] = "star",	["+"] = "plus",	["±"] = "pm",	["="] = "equal",	["~"] = "tilde",	[":"] = "colon",	[";"] = "scolon",	["."] = "point",	["!"] = "emark",	["?"] = "qmark",	["/"] = "slash",	["|"] = "vbar",	["\\"] = "bslash",	["("] = "oparen",	[")"] = "cparen",	["["] = "obrkt",	["]"] = "cbrkt",	["{"] = "obrace",	["}"] = "cbrace",	["<"] = "lthan",	[">"] = "gthan",	["¶"] = "pilcrow",	["&"] = "and",	["§"] = "ss",	["%"] = "percent",	["†"] = "dagger",	["‡"] = "diesis",	["#"] = "hash",	["°"] = "degree",	["$"] = "dol",	["€"] = "euro",	["¢"] = "cent",	["£"] = "pound",	["@"] = "at",	["©"] = "copy",	["®"] = "regtm",	["¤"] = "curren", }

-- Replace a text with div(s), with a special font on background -- Available: TeamMeat (https://bindingofisaacrebirth.gamepedia.com/File:Font_TeamMeat.png) --           TeamMeat-Bold (https://bindingofisaacrebirth.gamepedia.com/File:Font_TeamMeat_Bold.png) function p.font( f ) local args = rtable.trimAll( rtable.getArgs( f ) ) local _t = ' ' -- Get custom characters local char = {} if args.var1 then local i = 1 repeat char[i] = mw.text.split( args['var'..i], '-' ) i = i + 1 until not args['var'..i]	end -- Split string local characters = {} args[2]:gsub( ".", function(c) table.insert( characters, c ) end ) local j = 1 while characters[j] do -- Is a space ? if characters[j] == ' ' then _t = _t .. ' '		else -- Replace custom character for k, l in pairs( char ) do				if characters[j] == l[1] then characters[j] = l[2] break end end -- Is a special character ? characters[j] = p.specialCharacters[characters[j]] or characters[j] -- Replace character with a div _t = _t .. ' ' end j = j + 1 end return _t .. ' ' end

p.specialCharactersTitle = { ["+"] = "plus", [":"] = "colon", [";"] = "scolon", ["?"] = "qmark", ["/"] = "slash", ["|"] = "vbar", ["\\"] = "bslash", ["["] = "obrkt", ["]"] = "cbrkt", ["{"] = "obrace", ["}"] = "cbrace", ["<"] = "lthan", [">"] = "gthan", ["#"] = "hash" }

function p.title( f ) -- return ' ' .. ' ' end

return p