Модуль:Предмет: различия между версиями

мНет описания правки
мНет описания правки
Строка 75: Строка 75:


     -- Обработка LinkCard, если указан параметр wrapper
     -- Обработка LinkCard, если указан параметр wrapper
     if args["wrapper"] and args["wrapper"] ~= "" then
    local input_wrapper = argsWithWhitespace.wrapper
        local pixel = string.match(size, "(%d+)")
    local wrapper
       
     if input_wrapper == nil then
        local wrapperInfo
        wrapper = ""
        if input_repository == nil then
    else
            wrapperInfo = label .. prefix
    local pixel = string.match(size, "(%d+)")
        else
   
            wrapperInfo = label .. itemStack .. " " .. prefix .. " " .. itemContained .. " " .. itemSlot .. " " .. itemChem
    local wrapperInfo
        end
    if input_repository == nil then
 
        wrapperInfo = label .. prefix
        local imageParam = args["image"]
    else
        if imageParam == nil then
        wrapperInfo = label .. itemStack .. " " .. prefix .. " " .. itemContained .. " " .. itemSlot .. " " .. itemChem
            imageParam = id .. ".png"
    end
        elseif imageParam == "" then
            imageParam = ""
    local imageParam = args["image"]
        end
    if imageParam == nil then
 
        imageParam = id .. ".png"
        local linkParam = args["link"]
    elseif imageParam == "" then
        if not linkParam or linkParam == "" then
        imageParam = ""
            linkParam = itemName
    end
        end
 
    local linkParam = args["link"]
        return frame:preprocess(string.format(
    if not linkParam or linkParam == "" then
            "{{LinkCard|name=%s|image=%s|pixel=%s|link=%s|SideStyle=1}}",
        linkParam = itemName
            wrapperInfo, imageParam, pixel, linkParam
    end
        ))
    end
    return frame:preprocess(string.format(
        "{{LinkCard|name=%s|image=%s|pixel=%s|link=%s|SideStyle=1}}",
        wrapperInfo, imageParam, pixel, linkParam
    ))
end


     return frame:preprocess("<span>" .. result .. "</span>")
     return frame:preprocess("<span>" .. result .. "</span>")