Modul:WLink: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Wikipedia:Administratoren/Anfragen#Lua-Modul_aktualisieren PerfektesChaos 02:11, 17. Aug. 2017 (CEST)
wp>Herzi Pinki (https://de.wikipedia.org/w/index.php?title=Vorlage_Diskussion%3ALiteratur&type=revision&diff=164738195&oldid=164404700) |
wp>Holmium (Wikipedia:Administratoren/Anfragen#Lua-Modul_aktualisieren PerfektesChaos 02:11, 17. Aug. 2017 (CEST)) |
||
Zeile 1: | Zeile 1: | ||
local WLink = { suite = "WLink", | local WLink = { suite = "WLink", | ||
serial = "2017- | serial = "2017-08-17" }; | ||
--[=[ | --[=[ | ||
ansiPercent() | ansiPercent() | ||
Zeile 788: | Zeile 788: | ||
end | end | ||
if URLutil.isResourceURL( attempt ) then | if URLutil.isResourceURL( attempt ) then | ||
local site = URLutil.getAuthority( attempt ); | local site = URLutil.getAuthority( attempt ); | ||
local service = attempt; | |||
local show; | local show; | ||
if #attempt == #site then | if #attempt == #site then | ||
Zeile 795: | Zeile 796: | ||
show = URLutil.getTop3domain( "//" .. site ); | show = URLutil.getTop3domain( "//" .. site ); | ||
if show then | if show then | ||
local scan = "[%./](%a[%a%%%-] | local scan = "[%./](%a[%a%%%-]*%a)(%.%l%l%.)(%a+)$"; | ||
local search = "." .. show; | local search = "." .. show; | ||
local s1, s2, s3 = search:match( scan ); | local s1, s2, s3 = search:match( scan ); | ||
if s2 then | if s2 then | ||
if not second:find( s2, 1, true ) then | if not second:find( s2, 1, true ) then | ||
show = string.format( "%s | show = string.format( "%s%s", s2:sub( 2 ), s3 ); | ||
end | end | ||
else | else | ||
Zeile 812: | Zeile 813: | ||
end | end | ||
end | end | ||
r = string.format( "[%s %s]", | if not service:match( "^[a-z:]*//.+/" ) then | ||
service = service .. "/"; | |||
end | |||
r = string.format( "[%s %s]", service, show ); | |||
else | else | ||
r = attempt; | r = attempt; |