Home
Random
Nearby
Log in
Settings
About WikiV
Disclaimers
WikiV
Search
Editing
Module:Is infobox in lead
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 WikiV may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
Wikiv:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:Is infobox in lead/doc
(
edit
)