Toggle search
Search
Toggle menu
notifications
Toggle personal menu
Editing
Module:Is infobox in lead
From W.K.pedia
Views
Read
Edit source
View history
associated-pages
Module
Discussion
More actions
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.
Anti-spam check. Do
not
fill this in!
local p = {} function p.main (frame) return p._main (frame.args[1]) end function p._main (searchString) local content = mw.title.getCurrentTitle():getContent() local offset = string.find(content, "==", 1 , true) if offset then local lead = string.sub(content, 1, offset-1) if (string.find(lead, searchString)) then lead = lead :gsub( "{{%s-[Ii]nfobox%s-mapframe", "") --don't check for infobox mapframe :gsub( "{{%s-[Ii]nfobo[^}]-%|%s-embed%s-=%s-yes", "") --don't check for embeded infoboxes :gsub( "{{%s-[Ii]nfobo[^}]-%|%s-child%s-=%s-yes", "") --don't check for child infoboxes local iter = string.gmatch(lead, "{{%s-[Ii]nfobox") iter() if not iter() then --if able to find two infoboxes in the lead, then don't return true local iter2 = string.gmatch(content, searchString) iter2() if not iter2() then --if able to find two of the specific infobox in the article, then don't return true return true end end end end end return p
Summary:
Please note that all contributions to W.K.pedia are considered to be released under the Creative Commons Attribution-ShareAlike (see
awk:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Is infobox in lead/doc
(
edit
)