Module:Citation/CS1: Difference between revisions

    m>Trappist the monk
    m (is_parameter_ext_wikilink() fix;)
    m>Trappist the monk
    (bug fix in page number rendering (NoPP);)
    Line 2,174: Line 2,174:


    local function is_parameter_ext_wikilink (value)
    local function is_parameter_ext_wikilink (value)
    if value:match ("%[%[%a+:") then -- if a wikilink with namespace
    if value:match ("%[%[%a+:") then -- if a wikilink with namespace (interwiki)
    return false;
    return false;
    elseif value:match ("%[%a[%a%d%+%.%-]*:.*%]") or value:match ("%[//.*%]") then -- does the param value contain an external wikilink?
    elseif value:match ("%[%a[%a%d%+%.%-]*:.*%]") or value:match ("%[//.*%]") then -- does the param value contain an external wikilink?
    -- elseif value:match ("%[%a[%a%d%+%.%-]*:%S.*%]") or value:match ("%[//.*%]") then -- does the param value contain an external wikilink?
    return true;
    return true;
    else
    else
    Line 2,223: Line 2,224:
    local PPPrefix = A['PPPrefix']
    local PPPrefix = A['PPPrefix']
    local NoPP = A['NoPP']  
    local NoPP = A['NoPP']  
    if is_valid_parameter_value (NoPP, 'nopp', cfg.keywords ['yes_true_y']) then
    if is_set (NoPP) and is_valid_parameter_value (NoPP, 'nopp', cfg.keywords ['yes_true_y']) then
    PPPrefix = ''; -- unset these, prefix if used is in |page= or |pages=
    PPPrefix = ''; -- unset these, prefix if used is in |page= or |pages=
    PPrefix = '';
    PPrefix = '';
    Line 2,322: Line 2,323:
    local RegistrationRequired = A['RegistrationRequired'];
    local RegistrationRequired = A['RegistrationRequired'];
    if not is_valid_parameter_value (RegistrationRequired, 'registration', cfg.keywords ['yes_true_y']) then
    if not is_valid_parameter_value (RegistrationRequired, 'registration', cfg.keywords ['yes_true_y']) then
    registration=nil;
    RegistrationRequired=nil;
    end
    end
    local SubscriptionRequired = A['SubscriptionRequired'];
    local SubscriptionRequired = A['SubscriptionRequired'];
    if not is_valid_parameter_value (SubscriptionRequired, 'subscription', cfg.keywords ['yes_true_y']) then
    if not is_valid_parameter_value (SubscriptionRequired, 'subscription', cfg.keywords ['yes_true_y']) then
    subscription=nil;
    SubscriptionRequired=nil;
    end
    end