Content deleted Content added
No edit summary |
No edit summary |
||
Line 20:
-- @return {string} wikitext
function p.main( frame )
if not mw.isSubsting() then error( "Courtesy ping must be substituted" ) end▼
local args = getArgs( frame )
if not mw.isSubsting() or args['__demo'] then
end
local links = {}
local wikitext = args['wikitext'] or args[1] or nil
Line 48 ⟶ 49:
end
if not inWikiLink and not inPipedLink then
if wikitextArray[ k ] == '[' and wikitextArray[ k - 1 ] == '['
then
toProcess = ''
inWikiLink = true
end
else
if wikitextArray[ k ] == ']' and wikitextArray[ k - 1 ] == ']'
then
toProcess = mw.ustring.sub( toProcess,
mw.ustring.len( toProcess ) - 2 )
links = table.insert( links, toProcess )
toProcess = ''
Line 73 ⟶ 77:
end
return '<!-- Begin [[Module:Courtesy ping]] --> ' .. mw.text.trim( out )
.. ' <!-- End [[Module:Courtesy ping]] -->'
end
|