10.754
redigeringer
Lasse (diskussion | bidrag) No edit summary |
Lasse (diskussion | bidrag) No edit summary |
||
| Linje 228: | Linje 228: | ||
function generer_stykbeskrivelse (stykke, bog) | function generer_stykbeskrivelse (stykke, bog) | ||
if (mw.ustring.upper(mw.ustring.sub( bog, 1, 2 )) == "LB") then | if (mw.ustring.upper(mw.ustring.sub( bog, 1, 2 )) == "LB") then | ||
local stykbeskrivelse = stykke | |||
if (string.match(stykke, ",")) then | if (string.match(stykke, ",")) then | ||
| Linje 238: | Linje 240: | ||
-- strip '-' og resten | -- strip '-' og resten | ||
forstestykke, resten = stykke:match("(.+)-(.+)") | forstestykke, resten = stykke:match("(.+)-(.+)") | ||
return stykke .. 'stykke har BINDESTREG og det første er ' .. forstestykke .. ' og andet er ' .. resten | stykke = forstestykke | ||
-- return stykke .. 'stykke har BINDESTREG og det første er ' .. forstestykke .. ' og andet er ' .. resten | |||
end | end | ||
| Linje 248: | Linje 251: | ||
if ( tonumber(stykke) ~= nil) then | if ( tonumber(stykke) ~= nil) then | ||
return '[https://www.martinus.dk/da/onlinebibliotek/dtt/index.php?bog=' .. bogIDer[bog] .. '&stk=' .. | return '[https://www.martinus.dk/da/onlinebibliotek/dtt/index.php?bog=' .. bogIDer[bog] .. '&stk=' .. stykbeskrivelse .. ' ' .. stykke .. '])' | ||
end | end | ||