Module:Dash: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) No edit summary |
ArrowHead294 (talk | contribs) No edit summary |
||
| Line 6: | Line 6: | ||
if frame.args["spaces"] == "thin" then | if frame.args["spaces"] == "thin" then | ||
sp = " | sp = " " | ||
elseif frame.args["spaces"] == "hair" then | elseif frame.args["spaces"] == "hair" then | ||
sp = " | sp = " " | ||
else | else | ||
sp = " " | sp = " " | ||
| Line 14: | Line 14: | ||
if frame.args["separator"] == "mdash" then | if frame.args["separator"] == "mdash" then | ||
sp = " | sp = "—" | ||
elseif frame.args["separator"] == "ndash" then | elseif frame.args["separator"] == "ndash" then | ||
sp = " | sp = "–" | ||
else | else | ||
sp = "-" | sp = "-" | ||
end | end | ||
return frame.args["input_str"]:gsub("%s+", sp .. se .. sp) | return "<span>" .. frame.args["input_str"]:gsub("%s+", sp .. se .. sp) .. "</span>" | ||
end | end | ||
return p | return p | ||
Revision as of 03:30, 12 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["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