Module:RFX

-- --                         Module:RfX                              -- -- This is a library for retrieving information about Requests     -- -- for Stewardship, Requests for global rights and every other     -- -- request pages that has Support, Abstain and Oppose sections     -- --

local libraryUtil = require('libraryUtil') local lang = mw.getContentLanguage local textSplit = mw.text.split local umatch = mw.ustring.match local newTitle = mw.title.new

local rfx = {}

-- --        Helper functions         -- --

local function getTitleObject(title) local success, titleObject = pcall(newTitle, title) if success and titleObject then return titleObject else return nil end end

local function parseVoteBoundaries(section) -- Returns an array containing the raw wikitext of RfX votes in a given section. section = section:match('^.-\n#(.*)$') -- Strip non-votes from the start. if not section then return {} end section = section:match('^(.-)\n[^#]') or section -- Discard subsequent numbered lists. local comments = textSplit(section, '\n#') local votes = {} for i, comment in ipairs(comments) do		if comment:find('^[^#*;:].*%S') then votes[#votes + 1] = comment end end return votes end