Module:Dash

From Xenharmonic Wiki
Revision as of 03:30, 12 May 2024 by ArrowHead294 (talk | contribs)
Jump to navigation Jump to search
Module documentation[view] [edit] [history] [purge]
This module should not be invoked directly; use its corresponding template instead: Template:Dash.

Replaces comma and space in list with dashes and spaces.

Introspection summary for Module:Dash 
Functions provided (1)
Line Function Params
3 dashes (invokable) (frame)
Lua modules required (0)
Variable Module Functions used

No function descriptions were provided. The Lua code may have further information.


local p = {}

function p.dashes(frame)
	local sp = ""
	local se = ""
	
	if frame.args["spaces"] == "thin" then
		sp = " "
	elseif frame.args["spaces"] == "hair" then
		sp = " "
	else
		sp = " "
	end
	
	if frame.args["separator"] == "mdash" then
		sp = "—"
	elseif frame.args["separator"] == "ndash" then
		sp = "–"
	else
		sp = "-"
	end
	
	return "<span>" .. frame.args["input_str"]:gsub("%s+", sp .. se .. sp) .. "</span>"
end

return p