Modul:Text

This is [[MediaWiki:Tagline]]. Set to <code>display:none</code> by chameleon skin.
Version vom 7. Oktober 2016, 07:47 Uhr von imported>Oetterer (Die Seite wurde neu angelegt: „--[[ This library provides access to some lua methods of the mw.text library for mediawiki templates/articles. ]] local text = {} local getArgs = require(…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
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