Module:Template link general and Module:Template link general/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
put subst on if nolink |
drop `nocat` to make a cleaner diff for Template talk:Template link general#brace=on causes a documentation glitch at Template:Template link code |
||
| Line 32: | Line 32: | ||
end |
end |
||
| ⚫ | |||
local function linkTitle(args) |
local function linkTitle(args) |
||
| ⚫ | |||
| ⚫ | |||
return 'subst:' .. args['1'] |
|||
| ⚫ | |||
return args['1'] |
|||
| ⚫ | |||
| ⚫ | |||
local titleObj |
local titleObj |
||
| ⚫ | |||
if args['1'] then |
if args['1'] then |
||
-- This handles :Page and other NS |
-- This handles :Page and other NS |
||
| Line 49: | Line 41: | ||
titleObj = mw.title.getCurrentTitle() |
titleObj = mw.title.getCurrentTitle() |
||
end |
end |
||
| ⚫ | |||
addTemplate(args['1'])) |
|||
local textPart = args.alttext |
local textPart = args.alttext |
||
if not _ne(textPart) then |
if not _ne(textPart) then |
||
| Line 73: | Line 62: | ||
textPart = nw('{') .. textPart .. nw('}') |
textPart = nw('{') .. textPart .. nw('}') |
||
end |
end |
||
titlePart |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
'|' .. textPart .. ']]' |
|||
| ⚫ | |||
if _ne(args.braceinside) then |
if _ne(args.braceinside) then |
||
titlePart = nw('{') .. titlePart .. nw('}') |
titlePart = nw('{') .. titlePart .. nw('}') |
||
| ⚫ | |||
| ⚫ | |||
if bold then |
|||
| ⚫ | |||
end |
|||
| ⚫ | |||
| ⚫ | |||
end |
end |
||
return titlePart |
return titlePart |
||
| Line 90: | Line 92: | ||
function p._main(args) |
function p._main(args) |
||
| ⚫ | |||
local italic = _ne(args.italic) or _ne(args.italics) |
local italic = _ne(args.italic) or _ne(args.italics) |
||
local dontBrace = _ne(args.brace) or _ne(args.braceinside) |
local dontBrace = _ne(args.brace) or _ne(args.braceinside) |
||
| Line 97: | Line 98: | ||
local expand = _ne(args._expand) |
local expand = _ne(args._expand) |
||
| ⚫ | |||
local titlePart = linkTitle(args) |
local titlePart = linkTitle(args) |
||
| ⚫ | |||
| ⚫ | |||
-- Build the arguments |
-- Build the arguments |
||