Module:Check if redirect targets section
Jump to navigation
Jump to search
| File:Greek lc beta icon.svg | This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
Usage
[edit source]{{#invoke:Check if redirect targets section | run |PAGE_NAME}}
An example is {{#invoke:Check if redirect targets section | run | Module talk:Check if redirect targets section/Redirect to section}}
local p = {}
function p._run(page)
if not page or page == "" then return "false" end
title = mw.title.new(page)
if not title then return "false" end
local content = title:getContent()
if content and mw.ustring.find(content, "%[%[[^#]*#[^%]]+%]%]") then
return "true"
end
return "false"
end
function p.run(frame)
return p._run(frame.args[1])
end
return p