Jump to content

Module:Template link general: Difference between revisions

it doesn't fully appreciate nowiki or something
(oh this is why. Why did I fakepipe this?)
(it doesn't fully appreciate nowiki or something)
Line 62: Line 62:
if _ne(args.brace) then
if _ne(args.brace) then
textPart = '<nowiki>{{</nowiki>' .. textPart .. '<nowiki>}}</nowiki>'
textPart = '{{' .. textPart .. '}}'
elseif _ne(args.braceinside) then
elseif _ne(args.braceinside) then
textPart = '{' .. textPart .. '}'
textPart = '{' .. textPart .. '}'
Line 69: Line 69:
titlePart = titlePart .. '|' .. textPart .. ']]'
titlePart = titlePart .. '|' .. textPart .. ']]'
if _ne(args.braceinside) then
if _ne(args.braceinside) then
titlePart = '<nowiki>{' .. titlePart .. '}</nowiki>'
titlePart = '{' .. titlePart .. '}'
end
end
return titlePart
return titlePart
Line 104: Line 104:
-- final wrap
-- final wrap
local ret = titlePart .. textPart
local ret = titlePart .. textPart
if not dontBrace then ret = '<nowiki>{{</nowiki>' .. ret .. '<nowiki>}}</nowiki>' end
if not dontBrace then ret = '{{' .. ret .. '}}' end
if _ne(args.a) then ret = '<nowiki>*</nowiki>&nbsp;' .. ret end
if _ne(args.a) then ret = '<nowiki>*</nowiki>&nbsp;' .. ret end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
if _ne(args.kbd) then ret = '<kbd>' .. ret .. '</kbd>' end
Line 114: Line 114:
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
-- Wrap as html??
--[[ Wrap as html??  
local span = mw.html.create('span')
local span = mw.html.create('span')
span:wikitext(ret)
span:wikitext(ret)
--]]
return ret
return ret
end
end


return p
return p
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.