Module:Citation/CS1: Difference between revisions
replace all calls to z.mw.url with calls to mw.uri builtins
m>Dragons flight (don't need encoding) |
m>Dragons flight (replace all calls to z.mw.url with calls to mw.uri builtins) |
||
Line 27: | Line 27: | ||
local url_string = args.id | local url_string = args.id | ||
if args.encode == true or args.encode == nil then | if args.encode == true or args.encode == nil then | ||
url_string = | url_string = mw.uri.encode( url_string ); | ||
end | end | ||
Line 576: | Line 576: | ||
local OCinStitle = "ctx_ver=" .. ctx_ver -- such as "Z39.88-2004" | local OCinStitle = "ctx_ver=" .. ctx_ver -- such as "Z39.88-2004" | ||
for name,value in pairs(OCinSids) do | for name,value in pairs(OCinSids) do | ||
OCinStitle = OCinStitle .. "&rft_id=" . | OCinStitle = OCinStitle .. "&rft_id=" .. mw.uri.encode(name .. "/" .. value) | ||
end | end | ||
for name,value in pairs(OCinSdata) do | for name,value in pairs(OCinSdata) do | ||
OCinStitle = OCinStitle .. "&" .. name .. "=" . | OCinStitle = OCinStitle .. "&" .. name .. "=" .. mw.uri.encode(value) | ||
end | end | ||
OCinStitle = OCinStitle .. "&rfr_id=info:sid/en.wikipedia.org:" | OCinStitle = OCinStitle .. "&rfr_id=info:sid/en.wikipedia.org:" | ||
Line 1,234: | Line 1,234: | ||
local params = { class="citation wikicite" } | local params = { class="citation wikicite" } | ||
if id ~= "" and ( args.noid == nil or args.noid == "" ) then | if id ~= "" and ( args.noid == nil or args.noid == "" ) then | ||
params.id = | params.id = mw.uri.anchorEncode("endnote_" .. id .. arrow) | ||
end | end | ||
return z.mw.text.tag({name="span",contents=contents,params=params}) | return z.mw.text.tag({name="span",contents=contents,params=params}) |