tweak furigana regex

try to support text like:
今日[きょう]も <font color="#0000ff">元気[げんき]</font>
This commit is contained in:
Damien Elmes 2012-06-11 22:19:56 +09:00
parent 72102063bf
commit fec37958f4

View file

@ -6,10 +6,11 @@
import re
from anki.hooks import addHook
r = r' ?([^ ]+?)\[(.+?)\]'
r = r' ?([^[]+?)\[(.+?)\]([^ ]+?|$)'
ruby = r'<ruby><rb>\1</rb><rt>\2</rt></ruby>'
def noSound(repl):
repl += r"\3"
def func(match):
if match.group(2).startswith("sound:"):
# return without modification