Module:Contentious topics/aware explained

local p = local getArgs = require('Module:Arguments').getArgs

function p.detect(frame) local title local args = getArgs(frame) if args.testTitle then title = mw.title.new(args.testTitle) else title = mw.title.getCurrentTitle end local content = title:getContent or local codes = string.match(content, "}") local shortcutCodes = string.match(content, "}") local dsCodes = string.match(content, "}") if (not codes) and (not dsCodes) and (not shortcutCodes) then return end local text if (codes) then text = p._listToText(frame, mw.text.split(codes, "|")) elseif (dsCodes) then text = p._listToText(frame, mw.text.split(dsCodes, "|")) else text = p._listToText(frame, mw.text.split(shortcutCodes, "|")) end return frame:preprocess("

It is not necessary to notify this user about the following topics being contentious topics:" ..text.. "\n The user has indicated that they are already aware using the template {{Contentious topics/aware}} on their talk page.

" )end

function p.listToText(frame) return p._listToText(frame, getArgs(frame))end

function p._listToText(frame, t) local new = local t = require('Module:TableTools').compressSparseArray(t) for i,v in ipairs(t) do table.insert(new, frame:expandTemplate) end return '\n*'..table.concat(new, '\n*')end

return p