Template:FormatName: Difference between revisions

mNo edit summary
mNo edit summary
Line 32: Line 32:
   name = stdin:match(".+")
   name = stdin:match(".+")
---SUPER AND SUBSCRIPTS---
---SUPER AND SUBSCRIPTS---
   name = string.gsub( name, "_([%d.]+)^([%d.]+) ", '<span style="position:relative"><sub>%1</sub><span style="font-size:x-small;position:absolute;left:0px;top:-4px">%2</span></span>')
   name = string.gsub( name, "_([%d.]+)^([%d.]+) ", '<span style="line-height: 1em; font-size: x-small; position: absolute; font-family: monospace">%2<br>%1</span><span style="font-family: monospace; font-size: x-small">{{#createstring:&nbsp;|{{#max:{{#length:%1}}|{{#length:%2}}}}}}</span>')
   name = string.gsub( name, "%^([%d.]+)_([%d.]+) ", '<span style="position:relative"><sup>%1</sup><span style="font-size:x-small;position:absolute;left:0px;top:5px">%2</span></span>')
   name = string.gsub( name, "%^([%d.]+)_([%d.]+) ", '<span style="line-height: 1em; font-size: x-small; position: absolute; font-family: monospace">%1<br>%2</span><span style="font-family: monospace; font-size: x-small">{{#createstring:&nbsp;|{{#max:{{#length:%1}}|{{#length:%2}}}}}}</span>')
---SUPER/SUBSCRIPTS---
---SUPER/SUBSCRIPTS---
   name = string.gsub( name, "(%a)_{([%d.,%a]+)}", "%1<sub>%2</sub>" )
   name = string.gsub( name, "(%a)_{([%d.,%a]+)}", "%1<sub>%2</sub>" )

Revision as of 03:04, 24 February 2010