Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Editing Module:Gnoblin

From Deepest Lore
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
local p = {}
local p = {}
function p.gallery(frame)
    local text = frame.args[1] or ""
    local entries = {}
    for entry in mw.text.gsplit(text, ";") do
        entry = mw.text.trim(entry)
        if entry ~= "" then
            local separator = string.find(entry, "::", 1, true)
            local file
            local description
            if separator then
                file = mw.text.trim(string.sub(entry, 1, separator - 1))
                description = mw.text.trim(string.sub(entry, separator + 2))
            else
                file = entry
                description = ""
            end
            if file ~= "" then
                local galleryEntry = "File:" .. file
                if description ~= "" then
                    galleryEntry = galleryEntry .. "|" .. description
                end
                table.insert(entries, galleryEntry)
            end
        end
    end
    if #entries == 0 then
        return ""
    end
    return '<div class="character-gallery">' ..
        frame:extensionTag{
            name = "gallery",
            content = table.concat(entries, "\n")
        } ..
        '</div>'
end


function p.processTitle(frame)
function p.processTitle(frame)
Please note that all contributions to Deepest Lore may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Deepest Lore:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)