אונטערשייד צווישן ווערסיעס פון "יחידה:Lexicon"

378 בייטן צוגעלייגט ,  פֿאַר 2 יאָר
קיין רעדאגירונג באמערקונג
(ערשטע טריט)
 
אין תקציר עריכה
שורה 1: שורה 1:
local p = {}
local p = {}
local function stripToNil(text)
-- If text is a string, return its trimmed content, or nil if empty.
-- Otherwise return text (which may, for example, be nil).
if type(text) == 'string' then
text = text:match('(%S.-)%s*$')
local delink = require('Module:Delink')._delink
text = delink({text, wikilinks = "target"})
end
return text
end


function p.fetch(frame)
function p.fetch(frame)
שורה 6: שורה 17:
local args = getArgs(frame)
local args = getArgs(frame)
local data = mw.loadData('יחידה:Lexicon/Data')
local data = mw.loadData('יחידה:Lexicon/Data')
return data.words[args[1]]
local word = stripToNil(args[1])
return data.words[word]
end
end


return p
return p