Anonymous

Module:CommonFunctions: Difference between revisions

From Elwiki
no edit summary
No edit summary
No edit summary
Line 228: Line 228:
end
end


function link(page, text, suffix, dolink)
function link(page, text, prefix, suffix, dolink)
    local suffixString = ((suffix and suffix ~= "") and (' ' .. suffix) or '')
    local prefixString = ((prefix and prefix ~= "") and (' ' .. prefix) or '')
 
     if dolink == false then
     if dolink == false then
         return (text or page) .. ((suffix and suffix ~= "") and (' ' .. suffix) or '')
         return prefixString .. (text or page) .. suffixString
     end
     end
     return '[[' .. page .. '|' .. (text or page) .. ']]' .. ((suffix and suffix ~= "") and (' ' .. suffix) or '')
     return prefixString .. '[[' .. page .. '|' .. (text or page) .. ']]' .. suffixString
end
end