×
Create a new article
Write your page title here:
We currently have 1,665 articles on The Quelmar Wiki. Type your article name above or click on one of the titles below and start writing!



The Quelmar Wiki
Revision as of 18:30, 24 January 2024 by Spiderjjr45 (talk | contribs) (Created page with "local p = {} function p.count(frame) -- Get the content of the current article local content = mw.title.getCurrentTitle():getContent() -- Check if content is not nil if content == nil then return "Article content not available" end -- Count the words local _, wordCount = string.gsub(content, "%S+", "") -- Return the word count return tostring(wordCount) .. " words" end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Wordcount/doc

local p = {}

function p.count(frame)
    -- Get the content of the current article
    local content = mw.title.getCurrentTitle():getContent()

    -- Check if content is not nil
    if content == nil then
        return "Article content not available"
    end

    -- Count the words
    local _, wordCount = string.gsub(content, "%S+", "")

    -- Return the word count
    return tostring(wordCount) .. " words"
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies. (Hi Margarita's Table. 🇩🇪)
Cookies help us deliver our services. By using our services, you agree to our use of cookies. (Hi Margarita's Table. 🇩🇪)