Content deleted Content added
apparently the rest of the module relies on the padding being added, so how about padding with the empty string? |
|||
(31 intermediate revisions by 6 users not shown) | |||
Line 1:
-- This module implements [[Template:IPAc-en]].
local data = mw.loadData('Module:IPAc-en/data/sandbox')
local p = {}
Line 18 ⟶ 16:
local function makeNowrapSpan(s)
local span = mw.html.create('span')
:addClass('rt-commentedText') -- Works with [[MediaWiki:Gadget-ReferenceTooltips.js]]
:addClass('nowrap')
:wikitext(s)
Line 32 ⟶ 31:
-- This adds a tooltip icon to a label. It implements [[Template:H:title]].
local function makeTooltip(label, tooltip)
return string.format(
:attr('title', tooltip)▼
'<span title="%s">%s</span>',
mw.text.encode(tooltip, '|'),
label
end
Line 51 ⟶ 52:
local function renderCategories()
local ret = ''
▲ }
if
ret = {}
for cat in pairs(categories) do
Line 90 ⟶ 78:
if pronItem then
pron[#pron + 1] = pronItem
pron[#pron + 1] = ' '
else▼
pron[#pron + 1] = ''
end▼
else
break
Line 96 ⟶ 88:
end
if #pron > 0 then
ret[#ret + 1] = mw.getCurrentFrame():extensionTag({
name = 'templatestyles',
args = { src = 'Module:IPA/styles.css' }
})▼
ret[#ret + 1] = string.format(
'<span class="IPA-label IPA-label-small">%s</
table.concat(pron)
)
Line 129 ⟶ 125:
categories["Ill-formatted IPAc-en transclusions"] = true
words[#words + 1] = formatPhonemeGroup(phonemes)
args = {▼
}▼
words[#words + 1] = makeTooltip(
"<strong class=\"error\">[invalid input: '%s']</strong>",
'Unrecognized symbol'
)
Line 167 ⟶ 159:
-- Suppress Navigation popups and Page Previews (aka Hovercards)
:addClass('IPA nopopups noexcerpt')
:wikitext(string.format(
'[[Help:IPA/English|%s]]',
Line 179 ⟶ 172:
local file = args.audio and trim(args.audio)
if file and file ~= '' then
▲ else
▲ categories["Articles including recorded pronunciations (English)"] = true
▲ end
▲ ret[#ret + 1] = currentFrame:expandTemplate{
title = 'Template:IPA audio link', args = { file } }
end
|