Template:FormatName: Difference between revisions

No edit summary
No edit summary
Line 35: Line 35:
   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>')
   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>')


   name = string.gsub( name, "%^{([%x]+)}_{([%x]+)}", '<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>')
   name = string.gsub( name, "%^{([-%p%w]+)}_{([-%p%w]+)}", '<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 ])_{([-%p%w]+)}", "%1<sub>%2</sub>" )
   name = string.gsub( name, "([%a ])^{([%d.,%a]+)}", "%1<sup>%2</sup>" )
   name = string.gsub( name, "([%a ])^{([-%p%w]+)}", "%1<sup>%2</sup>" )
   name = string.gsub( name, "([%a%] ])_([D%d.]+)", "%1<sub>%2</sub>" )
   name = string.gsub( name, "([%a%] ])_([D%d.]+)", "%1<sub>%2</sub>" )
   name = string.gsub( name, "([%a%] ])^([D%d.]+)", "%1<sup>%2</sup>" )
   name = string.gsub( name, "([%a%] ])^([D%d.]+)", "%1<sup>%2</sup>" )

Revision as of 09:01, 24 February 2010