“モジュール:Trim quotes” のwerson間の差分
(en:Module:Trim quotes 2017年11月15日 (水) 23:19(UTC)より) |
(相違点なし)
|
2018 ppm 2 2018-02-17T15:27:46+00:00up 17 282018 (Toy.) 15:27時点におけるwerson
このモジュールについての説明文ページを モジュール:Trim quotes/doc に作成できます
local p = {}
local function _trim(s)
if s then
if mw.ustring.find(s,'^".*"$') or mw.ustring.find(s,"^'.*'$") then return _trim(string.sub(s,2,-2)) else return s end
else
return ""
end
end
function p.trim(frame)
local s = (frame.args['s'] or frame.args[1]) or (frame:getParent().args['s'] or frame:getParent().args[1])
return _trim(s)
end
return p