FANDOM


local MD = {}
local getArgs = require('Module:Arguments').getArgs
local language = mw.language.new('en')
 
function MD.pointer(frame) -- Implements {{&-whatever}}
	local args = getArgs(frame)
	return MD._pointer(args)
end
 
function MD.link(frame) -- Implements {{&&-whatever}}
	local args = getArgs(frame)
	return MD._link(args)
end
 
function MD._pointer( args )
    -- pointer with no visible label produces <meta itemprop='' content='' />
    -- args are itemprop, value, label, class, style, wrapper
    local span = mw.html.create(args['wrapper'] or 'span')
    :attr('itemprop', args['itemprop'] or args[2] or '')
    :addClass(args['class'] or '')
    :wikitext(args['content'] or args[1])
    :allDone()
    return tostring(span)
end
 
function MD._link( args )
    -- pointer with no visible label produces <meta itemprop='' content='' />
    -- args are value, itemprop, label, class, style, wrapper
    local span = mw.html.create(args['wrapper'] or 'span')
    :addClass(args['class'])
    :attr('itemprop', args['itemprop'] or args[2] or '')
    if args['style'] then span:attr('style', args['style']) end
    if args['link'] then 
    span:tag('data')
        :attr('itemprop', args['itemprop'] or args[2] or '')
        :attr('href', tostring(mw.uri.fullUrl( args['link'] )))
        :done()
    span:wikitext('[['..args['link']..']]')
    else
    span:wikitext(args['value'] or args[1])
    end
    span:allDone()
    return tostring(span)
 
end
 
return MD

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.