Модул:URL — разлика између измена

Садржај обрисан Садржај додат
м +
„крканска” поправка; у противном, без овога, template:official URL приказује нпр. "http://http://www.quezoncity.gov.ph/" уместо "www.quezoncity.gov.ph" у чланку Кезон Сити
Ред 49:
-- e.g. www.example.com/foo or www.example.com:8080/foo, and //www.example.com/foo
if uri and (not uri.protocol or (uri.protocol and not uri.host)) and url:sub(1, 2) ~= '//' then
url = mw.ustring.gsub(url, '[Hh][Tt][Tt][Pp]([Ss]?)://', '') -- this is to remove double protocol (e.g. "http://http://" in article [[Кезон Сити]])
url = 'http://' .. url
uri = safeUri(url)
Линија 65 ⟶ 66:
end
end
 
text = mw.ustring.gsub(text,"https?://","") -- this is to chop off any displayed "http://" or "https://"
text = mw.ustring.gsub(text,"/(%;sr%-e[cl])","%1") -- remove displayed trailing "/" for sr and sr-ec
text = mw.ustring.gsub(text,"/(%;%}%-)","%1") -- remove displayed trailing "/" for sr-el
 
-- text = mw.ustring.gsub(text,"%-%{","-") -- only a test function; remove comment -- and BREAK WHOLE OUTPUT! in order to see inside of it while previewing a page that uses [[template:official URL]]; example of broken output: displayed text is "-sr:www.quezoncity.gov.ph;sr-ec:www.quezoncity.gov.ph;sr-el:www.quezoncity.gov.ph;}-" and link address is "http://www.quezoncity.gov.ph/"
 
-- Add <wbr> before _/.-# sequences