Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in or
create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision |
Your text |
Line 1: |
Line 1: |
| -- Module:WordCount
| |
| local p = {} | | local p = {} |
|
| |
|
Line 10: |
Line 9: |
| return "Article content not available" | | return "Article content not available" |
| end | | end |
|
| |
| -- Replace HTML entities
| |
| content = mw.text.unstrip(content) -- Unstrip markers
| |
| content = mw.text.killMarkers(content) -- Remove markers left after unstrip
| |
| content = mw.text.decode(content) -- Decode HTML entities
| |
|
| |
|
| |
| -- Remove comments and some special formatting
| |
| content = content:gsub("%[%[.-|", "") -- Remove wiki links labellink brackets
| |
| content = content:gsub("{{.-}}", "") -- Remove template calls
| |
| content = content:gsub("======", "") -- Remove level 6 headers
| |
| content = content:gsub("=====", "") -- Remove level 5 headers
| |
| content = content:gsub("====", "") -- Remove level 4 headers
| |
| content = content:gsub("===", "") -- Remove level 3 headers
| |
| content = content:gsub("==", "") -- Remove level 2 headers
| |
| content = content:gsub("=", "") -- Remove level 1 headers headers
| |
|
| |
|
| -- Count the words | | -- Count the words |