“モジュール:Trim quotes” のwerson間の差分
(en:Module:Trim quotes 2017年11月15日 (水) 23:19(UTC)より) |
細 (1版 をインポートしました) |
||
(相違点なし)
| |||
2024 pam 3 2024-03-05T01:00:09+00:00up 5 312024 (Ape.) 01:00時点における最新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