Module:DLCLink

-- checks if the name contains a DLC-suffix and changes it to the according DLC-icon. then returns a link to name.

local p = {} function p.link(name, noDlcIcon) -- look up DLC icon info for the name with DissectDlcItemName local tryMatch = require('Module:DissectDlcItemName').tryMatch local info = tryMatch(name) if info then return ..info.displayName.... ((not noDlcIcon) and ' ' or '') end

-- if no dlc was found, use generic approach local title = mw.title.new(name) if title == nil then return 'page not found: ' .. name end local link = (#title.nsText > 0) and (title.fullText .. '|' .. title.text) or title.text return ..link.. end return p