Jump to content

Module:ArticleSize

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by ModulationBend (talk | contribs) at 07:40, 22 July 2024 (Measures article size in real time). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}

function p.size(frame)
    local title = frame.args[1] or mw.title.getCurrentTitle().text
    local page = mw.title.new(title)
    local content = page and page:getContent() or ""
    local size = #content
    return mw.language.getContentLanguage():formatNum(size)
end

return p