Module:Itemnumber: Difference between revisions

Created page with "local makeUrl = require('Module:URL')._url local p = {} -- Wrapper for pcall which returns nil on failure. local function quickPcall(func) local success, result = pcall(func) if success then return result end end -- Gets the rank for a Wikidata property table. Returns 1, 0 or -1, in -- order of rank. local function getRank(prop) local rank = prop.rank if rank == 'preferred' then return 1 elseif rank == 'normal' then return 0 elseif rank == 'deprecated' th..."
 
No edit summary
Line 100: Line 100:
ret[#ret + 1] = string.format(
ret[#ret + 1] = string.format(
'<span class="official-website">%s</span>',
'<span class="official-website">%s</span>',
makeUrl(options.url or options.wikidataurl, options.display)
makeUrl(options.url or options.wikidataurl) -- , options.display)
)
)
if options.wikidataurl and not options.url then
if options.wikidataurl and not options.url then
Line 146: Line 146:
url = url,
url = url,
wikidataurl = wikidataurl,
wikidataurl = wikidataurl,
display = args[2] or args.name or 'wikibase item: ',
display = args[2] or args.name or 'WB item: ',
format = args.format,
format = args.format,
mobile = args.mobile
mobile = args.mobile