m
1 revision imported from wikipedia:Module:Su
m (1 revision: What an ugly messy way to do this!) |
m (1 revision imported from wikipedia:Module:Su) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 20:
local options = {
align = args.a,
fontSize = args.w,
lineHeight = args.lh,
verticalAlign = args.va
}
return p._main(sup, sub, options)
Line 33 ⟶ 35:
['display'] = 'inline-block',
['margin-bottom'] = '-0.3em',
['vertical-align'] = options.verticalAlign or sub and '-0.4em' or '0.8em',
['line-height'] = options.lineHeight or '1.2em'
}
if options.fontSize == 'f' or options.fontSize == 'fixed' then
span:css{
['font-family'] = 'monospace
['font-size'] = '
}
else
span:css('font-size',
end
if options.align == 'r' or options.align == 'right' then
Line 54 ⟶ 56:
-- Add the wikitext.
span
:
:css('font-size', 'inherit')
:css('line-height', 'inherit')
:css('vertical-align', 'baseline')
:wikitext(sup)
:done()
:tag('br', {selfClosing = true}):done()
:
:css('font-size', 'inherit')
:css('line-height', 'inherit')
:css('vertical-align', 'baseline')
:wikitext(sub)
return tostring(span)
|