Module:IsValidPageName
Jump to navigation
Jump to search
| This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
Usage
This template returns "valid" if the given page title is valid, or the empty string otherwise. The page does not need to exist in order for the template to return "valid".
{{#invoke:IsValidPageName|isValidPageName|a potential page name}}
| The above documentation is transcluded from Module:IsValidPageName/doc. (edit | history) Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages. Subpages of this module. |
-- This module implements [[Template:isValidPageName]].
local export = {}
function export.isValidPageName(frame)
local success, res = pcall(mw.title.new, frame.args[1])
if success and res then
return "valid"
else
return ""
end
end
return export

