As a follow up to Furigana engine: modified version with various bugfixes, added features, I've tried to fix various issues which have cropped up, and posted the changes to https://gist.github.com/cyphr/6536814.
Changes are:
Fixed
<strong>
and<em>
tags with Furigana as at Why doesn't furigana work in italicized or bolded text?pre
blocks andcode
tags with Japanese text in them now use a Japanese font to fix Preformatted text in Japanese doesn't line up properly and Suggest adding Japanese monospace fonts to the CSS (pre
/code
tags which don't contain Japanese text still display using the original non-Japanese monospaced fonts for increased readability of e.g. rōmaji linguistic explanations and Englishpre
tables on Anime.SE etc).A fix for Chrome Kanji renderings murdering my eyes: how to fix? by explicitly making Japanese use Japanese fonts (in all browsers/OSes, not just Chrome) as well as working around this Chrome OS issue by adding
xml:lang="ja"
on Japanese text.A workaround for ruby getting squished on some mobile WebKit/Blink browsers, like Chrome on Android by making ruby a px font size if the ruby base text isn't similar in size to the surrounding text.
Made the browser title not have Furigana markup display for aesthetic reasons.
A fix for a bug where certain paragraphs wouldn't display Furigana due to a regular expression issue (
regex.test('...')
being used instead of'...'.match(regex)
).Implemented Earthling's suggestions so that お・ご honorifics work before Furigana, and
[漢字]【かな】
syntax/fullwidth braces as at Furigana in Japanese input mode using { } now work.I also added
漢字{かな}
syntax to the "help" text on the right of https://japanese.stackexchange.com/questions/ask. It was decided a long time ago at Deciding on an "officially recommended" format for furigana on JLU that漢字【かな】
syntax was to be preferred (and I think it visually is more attractive), but it's harder to input【】
characters than{}{}
and many people don't know how to do it.[[
...]]
and//
...//
and[/
.../]
syntax in non-<pre>
/<code>
tags now display in a font that can display IPA as at IPA and diacritic rendering.
The mobile site is theoretically supported as well, but I don't know whether this script can be added to it.
P.S. I'm not as active here as I once was, so if anyone wants to take over the development of this script feel free. Otherwise, I'll try to maintain/add features to it as the community here decides - please post any requests here in this thread, or as a separate meta post with a link to the post in the comments and I'll see what I can do :)