Jump to content

Module:Template link general: Difference between revisions

html:wikitext
No edit summary
(html:wikitext)
Line 62: Line 62:
if _ne(args.brace) then
if _ne(args.brace) then
textPart = '{{' .. textPart .. '}}'
textPart = '<nowiki>{{</nowiki>' .. textPart .. '<nowiki>}}</nowiki>'
elseif _ne(args.braceinside) then
elseif _ne(args.braceinside) then
textPart = '{' .. textPart .. '}'
textPart = '{' .. textPart .. '}'
Line 69: Line 69:
titlePart = titlePart .. '&#124;' .. textPart
titlePart = titlePart .. '&#124;' .. textPart
if _ne(args.braceinside) then
if _ne(args.braceinside) then
titlePart = '{' .. titlePart .. '}'
titlePart = '<nowiki>{' .. titlePart .. '}</nowiki>'
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 = '{{' .. ret .. '}}' end
if not dontBrace then ret = '<nowiki>{{</nowiki>' .. ret .. '<nowiki>}}</nowiki>' 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 113: Line 113:
end
end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
if _ne(args.nowrap) then ret = '<span class="nowrap">' .. ret .. '</span>' end
return ret
-- Wrap as html
local span = mw.html.create()
span:wikitext(ret)
return tostring(span)
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.