Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Undefined array key 1 in /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php on line 339

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 253

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 80
Модуль:Separated entries — Энциклопедия Акриции

Модуль:Separated entries

Версия от 08:44, 8 января 2024; Unifiedakricia (обсуждение | вклад) (Новая страница: «-- This module takes positional parameters as input and concatenates them with -- an optional separator. The final separator (the "conjunction") can be -- specified independently, enabling natural-language lists like -- "foo, bar, baz and qux". local compressSparseArray = require('Module:TableTools').compressSparseArray local p = {} function p._main(args) local separator = args.separator -- Decode (convert to Unicode) HTML escape sequences, such as "&#3...»)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Для документации этого модуля может быть создана страница Модуль:Separated entries/doc

-- This module takes positional parameters as input and concatenates them with
-- an optional separator. The final separator (the "conjunction") can be
-- specified independently, enabling natural-language lists like
-- "foo, bar, baz and qux".

local compressSparseArray = require('Module:TableTools').compressSparseArray
local p = {}

function p._main(args)
	local separator = args.separator
		-- Decode (convert to Unicode) HTML escape sequences, such as " " for space.
		and mw.text.decode(args.separator) or ''
	local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
	-- Discard named parameters.
	local values = compressSparseArray(args)
	return mw.text.listToText(values, separator, conjunction)
end

local function makeInvokeFunction(separator, conjunction)
	return function (frame)
		local args = require('Module:Arguments').getArgs(frame)
		args.separator = separator or args.separator
		args.conjunction = conjunction or args.conjunction
		return p._main(args)
	end
end

p.main = makeInvokeFunction()
p.br = makeInvokeFunction('<br />')
p.newline = makeInvokeFunction('\n')
p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())

return p

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at /lilacspace/sites/ru.wiki.akrt.me/extensions/Scribunto/includes/Engines/LuaStandalone/LuaStandaloneInterpreter.php:339) in /lilacspace/sites/ru.wiki.akrt.me/includes/Request/WebResponse.php on line 80