Template:FormatName: Difference between revisions

No edit summary
No edit summary
Line 6: Line 6:
   name = string.gsub( name, " delta%-", " δ-" )
   name = string.gsub( name, " delta%-", " δ-" )
   name = string.gsub( name, " Delta%-", " Δ-" )
   name = string.gsub( name, " Delta%-", " Δ-" )
   name = string.gsub( name, "_([%d]) ", "<sub>%1</sub> " )
   name = string.gsub( name, "_(%d%d?) ", "<sub>%1</sub> " )
  name = string.gsub( name, "^(%d%d?]) ", "<sup>%1</sup> " )
   print(name)
   print(name)
|{{{1|foo Delta-foo_2 fdol}}}}}
|{{{1|foo Delta-foo_21 fdol}}}}}

Revision as of 08:40, 19 January 2010

{{#lua:

 name = stdin:match("[^&]+")
 name = string.gsub( name, " alpha%-", " α-" )
 name = string.gsub( name, " beta%-", " β-" )
 name = string.gsub( name, " gamma%-", " γ-" )
 name = string.gsub( name, " delta%-", " δ-" )
 name = string.gsub( name, " Delta%-", " Δ-" )
 name = string.gsub( name, "_(%d%d?) ", "%1 " )
 name = string.gsub( name, "^(%d%d?]) ", "%1 " )
 print(name)

|foo Delta-foo_21 fdol}}