Module:Escape/doc
This is the documentation page for Module:Escape
| 40x40px | This module is rated as ready for general use. It has reached a mature form and is thought to be bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
Usage
This module is designed as an way to escape strings in a customized manner. There are two ways to call this module:
From another module:
local escape = require('Module:Escape')
From a template:
Template:Invoke:Escape
By default, this module will escape the \ char. To escape the { char instead, you can do require('Module:Escape'):char('{') (or esc:char('{') if you've stored table returned by this module in the local variable esc). When used in a template, set |char= equal to the char code.
test test \ test, \test, \,test\ \ \ \
To get an escaped string:
local foo = escape:
Here's some sample output from the debug consol below the module editor:
|
local escape = require('Module:Escape') |