Modul:Text

Permanently protected module
IMT HilfeWiki - das Wiki
Documentation icon Module documentation

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[Quelltext bearbeiten]


--[[
		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
Cookies helfen uns bei der Bereitstellung des IMT HilfeWikis. Bei der Nutzung vom IMT HilfeWiki werden die in der Datenschutzerklärung beschriebenen Cookies gespeichert.