Modul:WLink: Unterschied zwischen den Versionen

271 Bytes hinzugefügt ,  18. Mai 2016
2016-05-18
wp>PerfektesChaos
(2015-06-20)
wp>PerfektesChaos
(2016-05-18)
Zeile 1: Zeile 1:
local WLink = { suite  = "WLink",
local WLink = { suite  = "WLink",
                 serial = "2015-06-20" };
                 serial = "2016-05-18" };
--[=[
--[=[
ansiPercent()
ansiPercent()
Zeile 759: Zeile 759:


function WLink.getWeblink( attempt, anURLutil )
function WLink.getWeblink( attempt, anURLutil )
     -- Retrieve bracketed link from URL
     -- Retrieve bracketed link from resource URL
     -- Precondition:
     -- Precondition:
     --    attempt    -- string, with URL, or something different
     --    attempt    -- string, with URL, or something different
Zeile 774: Zeile 774:
     end
     end
     if URLutil.isResourceURL( attempt ) then
     if URLutil.isResourceURL( attempt ) then
         local scan = "[%./](%a+)(%.%l%l%.)(%a+)$";
         local site = URLutil.getAuthority( attempt );
         local show = URLutil.getTop3domain( attempt );
        local show;
        if #attempt == #site then
          site = site .. "/";
         end
        show = URLutil.getTop3domain( "//" .. site );
         if show then
         if show then
            local scan  = "[%./](%a+)(%.%l%l%.)(%a+)$";
             local search = "." .. show;
             local search = "." .. show;
             local s1, s2, s3 = search:match( scan );
             local s1, s2, s3 = search:match( scan );
Zeile 788: Zeile 793:
         end
         end
         if not show then
         if not show then
             show = URLutil.getTop2domain( attempt );
             show = URLutil.getTop2domain( "//" .. site );
            if not show then
                show = URLutil.getHost( "//" .. site );
            end
         end
         end
         r = string.format( "[%s %s]", attempt, show );
         r = string.format( "[%s %s]", attempt, show );
Anonymer Benutzer