Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.

Änderungen

Zur Navigation springen Zur Suche springen
852 Bytes hinzugefügt ,  23:09, 26. Jan. 2019
2019-01-01
Zeile 1: Zeile 1:  
local URIutil = { suite  = "URIutil",
 
local URIutil = { suite  = "URIutil",
                   serial = "2018-07-03",
+
                   serial = "2019-01-01",
 
                   item  = 19644443 };
 
                   item  = 19644443 };
 
--[=[
 
--[=[
Zeile 768: Zeile 768:  
     --    Returns  false if no problem detected
 
     --    Returns  false if no problem detected
 
     --              string with violation
 
     --              string with violation
    local s = fetch( "urn" ).sns;
   
     local r;
 
     local r;
     if type( s ) == "string" then
+
     if area == "urn" then
        r = string.format( ":%s:", area );
+
        r = "urn:";
        if s:match( r ) then
+
    else
            s = "[^%w%(%)%+,%-%.:=@;%$_!%*'].*$";
+
        local s = fetch( "urn" ).sns;
            r = acquire:match( s );
+
        if type( s ) == "string" then
        else
+
            r = string.format( ":%s:", area );
            r = string.format( ":%s:", area );
+
            if s:match( r ) then
        end
+
                s = "[^%w%(%)%+,%-%.:=@;%$_!%*'].*$";
        if not r then
+
                r = acquire:match( s );
            r = false;
+
            else
            if area == "isbn" then
+
                r = string.format( ":%s:", area );
                if not URIutil.isISBNvalid( acquire ) then
+
            end
                    r = acquire;
+
            if not r then
                end
+
                r = false;
            elseif area == "issn" then
+
                if area == "isbn" then
                if not URIutil.isISSNvalid( acquire ) then
+
                    if not URIutil.isISBNvalid( acquire ) then
                    r = acquire;
+
                        r = acquire;
 +
                    end
 +
                elseif area == "issn" then
 +
                    if not URIutil.isISSNvalid( acquire ) then
 +
                        r = acquire;
 +
                    end
 
                 end
 
                 end
 
             end
 
             end
Zeile 1.435: Zeile 1.439:       −
function URIutil.linkURN( attempt, alter, any1, any2, alert, at )
+
function URIutil.linkURN( attempt, alter, any1, any2, alert, at, alone )
 
     -- Retrieve bracketed titled external URN link
 
     -- Retrieve bracketed titled external URN link
 
     -- Precondition:
 
     -- Precondition:
Zeile 1.444: Zeile 1.448:  
     --    alert    -- string, with title of maintenance category, or nil
 
     --    alert    -- string, with title of maintenance category, or nil
 
     --    at      -- fragment, or nil
 
     --    at      -- fragment, or nil
 +
    --    alone    -- true, if link text not preceded by "urn:"
 
     -- Postcondition:
 
     -- Postcondition:
 
     --    Returns
 
     --    Returns
Zeile 1.450: Zeile 1.455:  
     local r2 = true;
 
     local r2 = true;
 
     local r;
 
     local r;
     if not URIutil.mayURI( attempt, true ) then
+
     if URIutil.mayURN( attempt ) then
 +
        local e = mw.html.create( "span" )
 +
                        :addClass( "invalid-URN" )
 +
                        :wikitext( attempt );
 +
        local s = flop( alert );
 +
        r = tostring( e ) .. fault( "(?!?!)" );
 +
        if s then
 +
            r = r .. s;
 +
        end
 +
    else
 
         local s = attempt:match( "^%s*[uU][rR][nN]:(%S+)%s*$" );
 
         local s = attempt:match( "^%s*[uU][rR][nN]:(%S+)%s*$" );
 
         if s then
 
         if s then
Zeile 1.465: Zeile 1.479:  
                         s = string.format( "%s:%s", space, sign );
 
                         s = string.format( "%s:%s", space, sign );
 
                         if r then
 
                         if r then
                             r = r:gsub( "%$1",  "urn:" .. s );
+
                             if alone then
 +
                                r2 = true;
 +
                            else
 +
                                r = r:gsub( "%$1",  "urn:" .. s );
 +
                            end
 
                             if at then
 
                             if at then
 
                                 r = string.format( "%s#%s", r, at );
 
                                 r = string.format( "%s#%s", r, at );
Zeile 1.486: Zeile 1.504:  
                                               space, sign );
 
                                               space, sign );
 
                         end
 
                         end
 +
                        r2 = not alone;
 
                     else
 
                     else
 
                         s = "link" .. space:upper();
 
                         s = "link" .. space:upper();
Zeile 1.505: Zeile 1.524:  
             r = mw.text.trim( attempt );
 
             r = mw.text.trim( attempt );
 
         end
 
         end
 +
        r2 = false;
 
     end
 
     end
 
     return r, r2;
 
     return r, r2;
Zeile 1.685: Zeile 1.705:  
                 r = s;
 
                 r = s;
 
             end
 
             end
        elseif mw.text.trim( attempt ) == "" then
  −
            r = false;
   
         else
 
         else
             r = "urn:";
+
             s = mw.text.trim( attempt );
 +
            if s == "" then
 +
                r = false;
 +
            elseif s:match( "^https?://" ) then
 +
                r = "http:";
 +
            else
 +
                r = "urn:";
 +
            end
 
         end
 
         end
 
     end
 
     end
Zeile 1.823: Zeile 1.848:  
     --    Returns  link, or plain string if bad URN
 
     --    Returns  link, or plain string if bad URN
 
     local r, l =
 
     local r, l =
              URIutil.linkURN( attempt, alter, false, false, alert, at );
+
        URIutil.linkURN( attempt, alter, false, false, alert, at, true );
 
     if l then
 
     if l then
 
         local s = fetch( "config" ).supportURN;
 
         local s = fetch( "config" ).supportURN;
Zeile 1.863: Zeile 1.888:  
                 local vsn = ent:formatPropertyValues( "P348" );
 
                 local vsn = ent:formatPropertyValues( "P348" );
 
                 if type( vsn ) == "table"  and
 
                 if type( vsn ) == "table"  and
                   type( vsn.value) == "string" and
+
                   type( vsn.value ) == "string" and
 
                   vsn.value ~= "" then
 
                   vsn.value ~= "" then
 
                     r = vsn.value;
 
                     r = vsn.value;
Cookies helfen uns bei der Bereitstellung von imedwiki. Durch die Nutzung von imedwiki erklärst du dich damit einverstanden, dass wir Cookies speichern.

Navigationsmenü