Modul:Respell
Robâ
TemplateStyles' src
attribute must not be empty.
Modul panèka kaèngkobhi. Modul nèka mèlaghis kantara sè èyangghuy kelabân andhân kaca, otabâ segghut èsubstitusi'aghi. Lakaran vandalisme otabâ kaklèrowan abhâdhi pangaro dâ' andhân kaca, tor beccè'an kèni' kèngèng maparèng tompoan rajâ dâ' server, modul nèka èsabhi, èlinḍhungè otabâ è'èngkobhi sabâgiyân ḍâri sabhârâng pameccè'an. |
TemplateStyles' src
attribute must not be empty.
This Lua module is used on many 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.
local p = {}
function p._main(args)
local ret = {}
for i, v in ipairs(args) do
v = mw.text.trim(v)
-- Compatibility: Ignore arguments that only contain an apostrophe
if v ~= '' and v ~= "'" then
if ret[#ret]
and not (ret[#ret]:find('_') or ret[#ret]:find('%-%)?$'))
and not (v:find('_') or v:find('^%(?%-'))
then
table.insert(ret, '-')
end
if v: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>'
if args.link ~= 'no' then
ret = '[[Help:Pronunciation respelling key|' .. ret .. ']]'
end
return ret
end
function p.main(frame)
return p._main(frame:getParent().args)
end
return p