Module:Discussion ping: Difference between revisions

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
if not mw.isSubsting() then error( "[[Module:Courtesy ping]] must be substituted" ) end
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
then
toProcess = ''
inWikiLink = true
end
else
if wikitextArray[ k ] == ']' and wikitextArray[ k - 1 ] == ']' then
then
toProcess = mw.ustring.sub( toProcess, mw.ustring.len( toProcess ) - 2 )
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