Sunday, April 25, 2010 12:00:00 AM
This script adds support for ruby annotation in Opera. (What about Firefox?)
What is ruby?
Ruby, here, is not the programming language Ruby but the ruby annotation used in web pages. These "ruby" are small texts that are usually displayed above base texts to show the pronunciation of characters used in East Asian languages.
What is the problem?
Ruby annotation itself is currently a W3C recommendation as a XHTML 1.1 module with a supporting CSS3 module for styling. However, the only browser to have any kind of built-in support is Internet Explorer which implemented the draft specification in IE 5 and Chrome 4 which now has rudimentary support for rendering the HTML5 draft spec ruby annotation.
Pure CSS solutions are possible in Opera with User Stylesheet (see download section), but they do not provide text spacing and will break when faced with unclosed ruby tags.
How does HTML Ruby solve it?
As mentioned above, this script adds support for rendering of ruby annotation in Opera. The script almost supports the full specification described in this draft for HTML ruby annotation and this W3C recommendation for XHTML ruby annotation and includes support for complete baseline alignment, the rbspan attribute, rb/rt text spacing, and unclosed ruby tags.
Try it for yourself at W3C's I18N Tests: Ruby markup and many other sites that use ruby annotation.
HTML Ruby 6 and optional settings file for Opera 10.5 (at userscripts.org)
CSS used in HTML Ruby can be used on its own as a User Stylesheet
If you experience messed-up encoding while using this script, refreshing the page or setting the encoding manually should solve the problem. This may occur when encountering unclosed ruby tags on a non-unicode page where there is no server-supplied encoding.
Ti, White Lynx, and xErath who helped me develop HTML Ruby and provided me with valuable feedback.