Content deleted Content added
create |
only make the file link pattern once |
||
Line 4:
local frame = mw.getCurrentFrame()
local
do
-- return frame:expandTemplate{title = 'icon', args = args}▼
return mIcon._main(args)▼
end▼
function suite:assertFileLink(s)▼
local spaces = '[_ \t]*'
local titleChar = '[^|<>%[%]{}]'
local titleCharOrPipe = '[^<>%[%]{}]'
titleChar .. '-' .. titleCharOrPipe .. '-|' .. titleChar .. '-|' ..
spaces .. 'link=' .. spaces .. '%]%]$'
▲end
local nsText = s:match(pattern)▼
local function icon(args)
▲ -- return mIcon._main(args)
end
▲function suite:assertFileLink(s)
nsText = nsText and nsText:lower()
self:assertTrue(nsText == 'file' or nsText == 'image')
|