ttempe / chinese-support-addon

Addon for Anki2 that makes easier to input Chinese, in the spirit of batterseapower’s pinyin-toolkit for Anki1
https://github.com/ttempe/chinese-support-addon/wiki
47 stars 19 forks source link

Characters in Ruby field disappear upon moving outside the field #67

Open kdam opened 7 years ago

kdam commented 7 years ago

System Info: Windows 10, Anki 2, Chinese Support v0.10.0
Note type: Any note (e.g. Chinese (Advanced)) with the Ruby field.
Settings: Local Dictionary - English; Transcription - Cantonese; Speech Engine - Google TTS Cantonese

Here is what I do:

  1. Type in Chinese characters in the Hanzi field, then press tab or click outside the field. This causes fields such as Reading, Color, Simplified, and Ruby to be auto-populated.
  2. Click inside the Ruby field to gain focus.
  3. Click outside the Ruby field to lose focus. The characters previously in the Ruby field disappear.

Clicking back inside the Hanzi field and then clicking outside can regenerate the Ruby field, but the same behavior occurs when clicking inside, then outside, the Ruby field.

Likewise, pressing Ctrl+Shift+X (Edit HTML) causes the Ruby characters to disappear.

Example:

  1. Enter text 蘑菇和茄子一起吃會中毒? into Hanzi field, then press tab.
  2. Ruby field now has the above sentence with jyutping as ruby text.
  3. Click inside the ruby field, then press tab. Chinese characters disappear and only non-Chinese characters remain.

Pressing Ctrl+Shift+X shows the following code:

<span class="tone4"></span><span class="tone1"></span><span class="tone4"></span><span class="tone1"></span><span class="tone2"></span><span class="tone1"></span><span class="tone2"></span><span class="tone1"></span><span class="tone2"></span><span class="tone1"></span><span class="tone5"></span>

which appears to just be the colorized formatting, without any characters.