Modul:WLink: Unterschied zwischen den Versionen

2019-06-17, siehe https://de.wikipedia.org/w/index.php?title=Wikipedia:Administratoren/Anfragen&curid=6974524&diff=189628063&oldid=189625851
w>Cactus26
K (ansiPercent fixed for codes < 0x10)
w>NordNordWest
(2019-06-17, siehe https://de.wikipedia.org/w/index.php?title=Wikipedia:Administratoren/Anfragen&curid=6974524&diff=189628063&oldid=189625851)
Zeile 1: Zeile 1:
local WLink = { suite  = "WLink",
local WLink = { suite  = "WLink",
                 serial = "2019-05-25",
                 serial = "2019-06-17",
                 item  = 19363224 };
                 item  = 19363224 };
--[=[
--[=[
Zeile 744: Zeile 744:
                 if k > 1 then
                 if k > 1 then
                     n      = n - k;
                     n      = n - k;
                     i      = j + k;
                     i      = j + k + 1;
                     j      = i - 1;
                     j      = i - 1;
                     suffix = r:sub( j );
                     suffix = r:sub( j );
Zeile 1.203: Zeile 1.203:
     -- Postcondition:
     -- Postcondition:
     --    Returns  boolean
     --    Returns  boolean
     local s, r = WLink.getTarget( attempt );
     local u, r = WLink.getTarget( attempt );
     if r then
     if r then
         r = true;
         if r < 2 then
            if u:find( "''", 1, true ) then
                r = false;
            else
                r = true;
            end
        else
            r = true;
        end
     end
     end
     return r;
     return r;
Zeile 1.212: Zeile 1.220:




function WLink.isValidLinktext( attempt )
function WLink.isValidLinktext( attempt, allow )
     -- Is attempt a plain inline text?
     -- Is attempt a plain inline text?
     -- Precondition:
     -- Precondition:
     --    attempt  -- string, with presumable linktext
     --    attempt  -- string, with presumable linktext
    --    allow    -- boolean or nil, if multiline permitted
     -- Postcondition:
     -- Postcondition:
     --    Returns  boolean
     --    Returns  boolean
Zeile 1.224: Zeile 1.233:
     else
     else
         r = ( mw.text.unstrip( attempt ) == attempt );
         r = ( mw.text.unstrip( attempt ) == attempt );
    end
    if r  and  not allow  and  attempt:find( "\n", 1, true ) then
        r = false;
     end
     end
     if r then
     if r then
Zeile 1.568: Zeile 1.580:
                 safe = v;
                 safe = v;
             end
             end
        elseif k == "lines"  and  action == "isValidLinktext" then
            space = ( k == "1" );
         elseif k ~= "template" then
         elseif k ~= "template" then
             lucky = false;
             lucky = false;
Anonymer Benutzer