mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
tweak furigana regex
try to support text like: 今日[きょう]も <font color="#0000ff">元気[げんき]</font>
This commit is contained in:
parent
72102063bf
commit
fec37958f4
1 changed files with 2 additions and 1 deletions
|
@ -6,10 +6,11 @@
|
||||||
import re
|
import re
|
||||||
from anki.hooks import addHook
|
from anki.hooks import addHook
|
||||||
|
|
||||||
r = r' ?([^ ]+?)\[(.+?)\]'
|
r = r' ?([^[]+?)\[(.+?)\]([^ ]+?|$)'
|
||||||
ruby = r'<ruby><rb>\1</rb><rt>\2</rt></ruby>'
|
ruby = r'<ruby><rb>\1</rb><rt>\2</rt></ruby>'
|
||||||
|
|
||||||
def noSound(repl):
|
def noSound(repl):
|
||||||
|
repl += r"\3"
|
||||||
def func(match):
|
def func(match):
|
||||||
if match.group(2).startswith("sound:"):
|
if match.group(2).startswith("sound:"):
|
||||||
# return without modification
|
# return without modification
|
||||||
|
|
Loading…
Reference in a new issue