Module:Dash: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) No edit summary |
ArrowHead294 (talk | contribs) No edit summary |
||
| Line 17: | Line 17: | ||
if frame.args["d"] == "long" then | if frame.args["d"] == "long" then | ||
se = "—" | se = "—" | ||
elseif frame.args["d"] == "med" then | elseif frame.args["d"] == "med" or frame.args["d"] == "medium" then | ||
se = "–" | se = "–" | ||
else | else | ||
Revision as of 01:43, 13 May 2024
- 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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||
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["s"] == "thin" then
sp = " "
elseif frame.args["s"] == "hair" then
sp = " "
elseif frame.args["s"] == "space" then
sp = " "
else
sp = ""
end
if frame.args["d"] == "long" then
se = "—"
elseif frame.args["d"] == "med" or frame.args["d"] == "medium" then
se = "–"
else
se = "-"
end
local out_str = frame.args["input_str"]:gsub(",%s+", sp .. se .. sp)
return "<span>" .. out_str .. "</span>"
end
return p