Difference between revisions of "Module:Unstrip"

From blackwiki
Jump to navigation Jump to search
blackwiki>MusikAnimal
m (Protected "Module:Unstrip": High-risk module ([Edit=Require template editor access] (indefinite)))
blackwiki>Pppery
(Merging in Module:KillMarkers per TfD)
Line 9: Line 9:
 
return mw.text.unstripNoWiki(frame.args[1] or '')
 
return mw.text.unstripNoWiki(frame.args[1] or '')
 
end
 
end
 
+
function p.killMarkers(frame)
 +
local text = frame.args[1]
 +
text = mw.text.killMarkers(text)
 +
:gsub("^%s+", "") --strip leading
 +
:gsub("%s+$", "") --and trailing spaces
 +
end
 
return p
 
return p

Revision as of 23:36, 25 May 2019

-- This module provides a frontend to the mw.text.unstrip and unstripNoWiki functions
local p = {}

function p.unstrip(frame)
	return mw.text.unstrip(frame.args[1] or '')
end

function p.unstripNoWiki(frame)
	return mw.text.unstripNoWiki(frame.args[1] or '')
end
function p.killMarkers(frame)
	local text = frame.args[1]
	text = mw.text.killMarkers(text)
		:gsub("^%s+", "") --strip leading
		:gsub("%s+$", "") --and trailing spaces
end
return p