This is a third-party script and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.
General script installation instructions
IME2Furigana
What does it do?
The script targets the reply textbox of the WaniKani forum. It adds two functionalities:
-
Furigana markup
Writing<.漢字>[かんじ]
results in 漢字, while writing<.漢字>{かんじ}
results in 漢字. -
IME input to furigana markup
The script takes what you have entered in your IME and converts it into furigana markup.
Example: you write ふりがな
, then select 振り仮名 from the list in your IME, and the result is <.振>[ふ]り<.仮名>[がな]
which gets displayed as 振り仮名.
This also means that you have to write the whole word before selecting an entry from the IME. If you stop at ふりが
and then select 振り仮名 from the IME suggestions, you will get 振り仮名.
Furthermore this script is unaware of any kanji readings, so it is not able to display 四月 as 四月 (correctly mapped し to 四 and がつ to 月) but only as 四月. But it seems that several people prefer it like this anyway.
Script modes
This script adds a button (labeled “F”) to the reply box in the WaniKani forum. Clicking this button (or using Ctrl+Shift+F) switches between 3 modes:
- off: both script functionalities disabled
- on: furigana is added as soon as an entry has been chosen in the IME
- blur: same as on, but the furigana is marked as spoiler - so it is blurred until clicked (example: 振り仮名)
How to use it:
Make sure that you have IME2Furigana enabled (click the F button if it is not enabled):
Type the whole word/phrase/sentence into your IME (don’t use prediction before you have fully typed what will be used as furigana):
After letting the IME convert it to kanji, it will be replaced with furigana markup:
(Since this screenshot was taken, the furigana markup was changed to include a dot to avoid conflicts with HTML tags.)
Converting ruby markup to furigana markup
As soon as ruby markup is detected in the input box (maybe because you are quoting another post that used ruby, or you pasted ruby markup from another page, or you are editing one of your own posts that used ruby markup), IME2Furigana offers to convert it into furigana markup:
After accepting by clicking the check mark, the long ruby markup is replaced with the more compact furigana markup in the input box:
(Since this screenshot was taken, the furigana markup was changed to include a dot to avoid conflicts with HTML tags.)
Warnings
- There is a known issue due to a Discourse update: the Discourse formatting tools (e.g. Ctrl+i or clicking the “Emphasis” button with some text after the first furigana markup occurrence selected will produce incorrect results.
- The furigana markup was changed to include a dot to distinguish it from HTML tags, to prevent the conversion from being applied in unintended places. But it might still be advisable to double-check for misconversions before saving a post – especially when editing a long wiki post. If the post should not contain any furigana, it might be best to turn off the F button, or make sure that there is no blue indicator in the F button (the blue line below the F button signifies, that IME2Furigana has found text that looks like furigana markup).
Version history
v 1.8 (Fallback method)
- Added fallback method if original method does not work
- F button now indicates if IME2Furigana tampers with your input
- Added hotkey for changing the mode
- You can now undo the automatic furigana markup
v 1.7 (Bugfixes)
v 1.6 (Script mode initialized to "on" + 2 bugfixes)
v 1.5 (Bugfix for browsers not supporting RegExp negative lookbehind)
v 1.4 (Furigana bugfix)
v 1.3 (Added setting for unprompted ruby to furigana markup conversion)
v 1.2 (Ruby to furigana markup feature)
v 1.1 (fixed typo)
v 1.0 (Added furigana markup functionality)
Added furigana markup functionality
IME input gets converted to furigana markup
Button state is now persistent
To the post with details about this patch
v 0.3 (button state bugfix)
v 0.2 (rp tags)
Now also creates <rp>
tags
To the post with details about this patch