Not logged in
Talk
Contributions
Log in
Navigation
Main page
Recent changes
Random page
Upload file
Module
Discussion
Edit
View history
Editing
Module:Error
From Body Communication
Jump to:
navigation
,
search
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!
-- This module implements {{error}}. local p = {} local function _error(args) local tag = mw.ustring.lower(tostring(args.tag)) -- Work out what html tag we should use. if not (tag == 'p' or tag == 'span' or tag == 'div') then tag = 'strong' end -- Generate the html. return tostring(mw.html.create(tag) :addClass('error') :wikitext(tostring(args.message or args[1] or error('no message specified', 2))) ) end function p.error(frame) local args if type(frame.args) == 'table' then -- We're being called via #invoke. The args are passed through to the module -- from the template page, so use the args that were passed into the template. args = frame.args else -- We're being called from another module or from the debug console, so assume -- the args are passed in directly. args = frame end -- if the message parameter is present but blank, change it to nil so that Lua will -- consider it false. if args.message == "" then args.message = nil end return _error(args) end return p
Summary:
Please note that all contributions to Body Communication are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (see
Body Communication: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:Error/doc
(
edit
)
Tools
What links here
Related changes
Special pages
Page information