Home
Random
Log in
Settings
About MISERY wiki
Disclaimers
MISERY wiki
Search
Editing
Module:Parser
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.getTemplateArgsFromRaw(rawContent, options) options = options or {} local templates = p._parseFormat(rawContent, options.only) if options.only then templates = templates[options.only] or {} end return templates end function p.getTemplateArgs(page, options) options = options or {} local rawContent = '' if options.custom then rawContent = page else local title = mw.title.makeTitle(options.namespace or '', page) if title == nil then return {} end rawContent = title:getContent() if rawContent == nil or rawContent == '' then return {} end end rawContent = (rawContent:gsub('<!%-%-.-%-%->', '')) .. '\n' -- remove strip markers (e.g., <ref></ref> ) if options.unstrip then rawContent = mw.text.unstrip(rawContent) end local templates = p._parseFormat(rawContent, options.only) -- return only specific template to simplify usage if options.only then templates = templates[options.only] or {} end -- return raw page content too for extra parsing if options.pageContent then templates.PAGECONTENT = rawContent end -- return parsed content return templates end return p
Summary:
Please note that all contributions to MISERY wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
MISERY: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)
Pages included on this page:
Template:Delete
(
edit
)
Template:MessageBox
(
edit
)
Module:Arguments
(
edit
)
Module:Mbox
(
edit
)
Module:Parser/doc
(
edit
)