toHtml (Command "br" _) = "\n<br/>\n"
toHtml (Command "cent" _) = "½"
toHtml (Command "euro" _) = "€"
- toHtml (Command "ordinal" x) = (toHtml x)++"<sup>"++"th"++"</sup>"
+
+ -- gross hack
+ toHtml (Command "ordinal" x) | (last (toHtml x) == '1') = (toHtml x)++"<sup>"++"st"++"</sup>"
+ | (last (toHtml x) == '2') = (toHtml x)++"<sup>"++"nd"++"</sup>"
+ | (last (toHtml x) == '3') = (toHtml x)++"<sup>"++"rd"++"</sup>"
+ | otherwise = (toHtml x)++"<sup>"++"th"++"</sup>"
+
-- FIXME: use "unicode vulgar fractions" here
toHtml (Command "fraction" [n,d]) = "<sup>"++(toHtml n)++"</sup>"++"/"++"<sub>"++(toHtml d)++"</sub>"
toHtml (Command "rfc" x) = "<tt><a href=http://tools.ietf.org/html/rfc"++(toHtml x)++">RFC"++(toHtml x)++"</a></tt>"