"ഘടകം:InfoboxSchool" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

'local p = {} function p.getRevenueDistrict(frame) local page = frame.args.page if not page or page == '' then return '' end local title = mw.title.new(page) if not title then return '' end local content = title:getContent() if not content then return '' end -- Match Infobox School and extract "റവന്യൂ ജില്ല" local district = co...' താൾ സൃഷ്ടിച്ചിരിക്കുന്നു
 
No edit summary
 
വരി 10: വരി 10:
     if not title then
     if not title then
         return ''
         return ''
    end
    -- Follow redirect
    if title.isRedirect then
        title = title.redirectTarget
        if not title then
            return ''
        end
     end
     end


വരി 17: വരി 25:
     end
     end


     -- Match Infobox School and extract "റവന്യൂ ജില്ല"
     -- Extract Infobox School block
     local district = content:match('{{%s*Infobox School.-\n.-|%s*റവന്യൂ%s*ജില്ല%s*=%s*([^\n|}]+)')
     local infobox = content:match('{{%s*Infobox School(.-)}}')
   
    if not infobox then
        return ''
    end
 
    -- Extract Revenue District
    local district = infobox:match('|%s*റവന്യൂ%s*ജില്ല%s*=%s*([^\n|}]+)')
 
     if district then
     if district then
         district = mw.text.trim(district)
         return mw.text.trim(district)
     end
     end


     return district or ''
     return ''
end
end


return p
return p
"https://schoolwiki.in/ഘടകം:InfoboxSchool" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്