Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 15:27, 16 December 2025 by Admin (talk | contribs) (Created page with "local p = {} -- Find which ch_x corresponds to the matching location_x function p.findChapter(frame) local args = frame.args local needle = (args.location or ''):gsub('%[%[',''):gsub('%]%]','') for i = 1, 6 do local hay = (args['location_' .. i] or ''):gsub('%[%[',''):gsub('%]%]','') if hay:find(needle, 1, true) then return args['ch_' .. i] or '' end end return 'Unknown' end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:LocationMatch/doc

local p = {}

-- Find which ch_x corresponds to the matching location_x
function p.findChapter(frame)
    local args = frame.args
    local needle = (args.location or ''):gsub('%[%[',''):gsub('%]%]','')
    for i = 1, 6 do
        local hay = (args['location_' .. i] or ''):gsub('%[%[',''):gsub('%]%]','')
        if hay:find(needle, 1, true) then
            return args['ch_' .. i] or ''
        end
    end
    return 'Unknown'
end

return p