Module:Respell/sandbox
Appearance
From Wikipedia, the free encyclopedia
This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing.
Warning This Lua module is used on approximately 22,000 pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.
This module implements {{Respell }}. Please see the template page for documentation.
The above documentation is transcluded from Module:Respell/doc. (edit | history)
Editors can experiment in this module's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
Editors can experiment in this module's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
localp={} functionp._main(args) localret={} fori,vinipairs(args)do v=mw.text.trim(v) -- Compatibility: Ignore arguments that only contain an apostrophe ifv~=''andv~="'"then ifret[#ret] andnot(ret[#ret]:find('_')orret[#ret]:find('%-%)?$')) andnot(v:find('_')orv:find('^%(?%-')) then table.insert(ret,'-') end ifv:find('^[%u%(%)]+$')then v='<span style="font-size:90%">'..v..'</span>' end table.insert(ret,v) end end ret='<i title="English pronunciation respelling">'.. table.concat(ret):gsub('_',' ') -- Avoid dangling hyphens :gsub(' %-',' -⁠') :gsub('^%-','-⁠') ..'</i>' ifargs.link~='no'then ret='[[Help:Pronunciation respelling key|'..ret..']]' end returnret end functionp.main(frame) returnp._main(frame:getParent().args) end returnp