Content deleted Content added
a module to generate Perseus links for refs, starting with Smyth's Greek Grammar |
debug, allow multiple separators |
||
Line 23:
function export.SmythSection(frame)
local output = ""
local sections = frame.args[1]
local section, separators = {}, {}
local part = frame.args[2]
if sections then
n = 1
for separator, number in string.gmatch(sections, "([^%d]*)(%d+)") do
section[n] =
if separator == "" or separator == nil then
separators[n] = ""
else
separators[n] = separator
end
if section[n] == nil or section[n] == "" then
n = false
Line 39 ⟶ 45:
end
for i = 1, #section do
output = output .. separators[i] .. "[" .. Smyth(section[i]) .. " " .. section[i] .. "]"
end
return output
end
return export
|