Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 07:10, 20 August 2020 by commons>Sarang (format)
Module documentation[ create · purge ]
This documentation is transcluded from Module:Char/doc.
-- This function can substitute some critical leading characters
-- by their decimal numeric character references
-- to avoid their interpretion as wiki syntax

local ncr = {}

-- global / local; changes #/*/:/;  to \35/\42/\58/\59
function ncr.subst      ( frame )
	local gpar = frame.args
	local char = ''
	if gpar then char = mw.text.trim ( gpar[1] )-- global
		else	 char = mw.text.trim ( frame )	-- local
	end
	return mw.text.nowiki( char );
end

-- alias long function name for abbreviation 
function  ncr.substitute ( frame )
	local args  = frame.args
	local str   = args[1]
	return ncr.subst ( str )
end

return ncr;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.