Module:Article history/config: Difference between revisions

Content deleted Content added
refactor the "spurious bullet" category code to use the "categories" config function - this lets us use the existing category suppression system
back to old version, tracking now complete
Line 1,847:
end,
makeData = function (articleHistoryObj)
local data =return makeDateData(articleHistoryObj, 'dyk', {'entry'})
data.entryHasBullet = false
for i, t in ipairs(data) do
if t.entry then
local count
t.entry, count = t.entry:gsub('^%s*%*%s*', '')
if count > 0 then
data.entryHasBullet = true
end
end
end
return data
end,
text = function (articleHistoryObj, collapsibleNoticeObj)
Line 1,924 ⟶ 1,913:
categories = function (articleHistoryObj, collapsibleNoticeObj)
local cats = {}
 
-- Standard DYK category
local status = articleHistoryObj:getStatusId()
local cat
Line 1,937 ⟶ 1,924:
cat = 'Wikipedia Did you know articles'
end
cats[#cats + 1] = Category.new(cat)
 
-- Category for spurious bullets
local data = collapsibleNoticeObj:getData(articleHistoryObj)
if data and data.entryHasBullet then
cats[#cats + 1] = Category.new(
'Pages using article history with a spurious bullet'
)
end
 
return cats
end