mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
handle nbsp in furigana (#327)
This commit is contained in:
parent
340ed59b15
commit
55cd51c079
1 changed files with 6 additions and 3 deletions
|
@ -18,14 +18,17 @@ def noSound(repl):
|
||||||
return re.sub(r, repl, match.group(0))
|
return re.sub(r, repl, match.group(0))
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
def _munge(s):
|
||||||
|
return s.replace(" ", " ")
|
||||||
|
|
||||||
def kanji(txt, *args):
|
def kanji(txt, *args):
|
||||||
return re.sub(r, noSound(r'\1'), txt)
|
return re.sub(r, noSound(r'\1'), _munge(txt))
|
||||||
|
|
||||||
def kana(txt, *args):
|
def kana(txt, *args):
|
||||||
return re.sub(r, noSound(r'\2'), txt)
|
return re.sub(r, noSound(r'\2'), _munge(txt))
|
||||||
|
|
||||||
def furigana(txt, *args):
|
def furigana(txt, *args):
|
||||||
return re.sub(r, noSound(ruby), txt)
|
return re.sub(r, noSound(ruby), _munge(txt))
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
addHook('fmod_kanji', kanji)
|
addHook('fmod_kanji', kanji)
|
||||||
|
|
Loading…
Reference in a new issue