Modul:Text

This is [[MediaWiki:Tagline]]. Set to <code>display:none</code> by chameleon skin.
Wechseln zu:Navigation, Suche
Documentation icon Module documentation[view] [edit] [history] [purge]

This module provides access to various lua functions from the mw.text library. See corresponding lua manual entries for more information.

{{#invoke:Text|function_name|args}}

See also

--[[
		This library provides access to some lua methods of the mw.text library for
		mediawiki templates/articles.
]]

local text = {}
local getArgs = require('Module:Arguments').getArgs

function text.killMarkers(frame)
	local args = getArgs(frame)
	return mw.text.killMarkers(args[1] or args.text )
end


function text.nowiki(frame)
	local args = getArgs(frame)
	local result = ''
	local separator = '\n\n'
	
	if args.sep then
		separator = args.sep
		args.sep = nil
	end
	if args.separator then
		separator = args.separator
		args.separator = nil
	end
	
	for _, v in pairs(args) do
		result = result .. '(' .. #v .. '): ' .. mw.text.nowiki(v) .. separator
	end
	
	return result
end


function text.unstrip(frame)
	local args = getArgs(frame)
	return mw.text.decode( mw.text.unstrip(args[1] or args.text) )
end

return text