mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
add furigana to decks on upgrade
This commit is contained in:
parent
5d3e31ca5d
commit
e5bf86c40e
1 changed files with 8 additions and 0 deletions
|
@ -476,6 +476,14 @@ order by ordinal""", mid)):
|
||||||
t[k] = re.sub("color: ?#000(000)?;?", "", t[k])
|
t[k] = re.sub("color: ?#000(000)?;?", "", t[k])
|
||||||
t[k] = re.sub("white-space: ?pre-wrap;?", "", t[k])
|
t[k] = re.sub("white-space: ?pre-wrap;?", "", t[k])
|
||||||
t[k] = re.sub('<span style=" *">(.+?)</span>', '\\1', t[k])
|
t[k] = re.sub('<span style=" *">(.+?)</span>', '\\1', t[k])
|
||||||
|
# new furigana handling
|
||||||
|
if "japanese" in m['name'].lower():
|
||||||
|
if k == 'qfmt':
|
||||||
|
t[k] = t[k].replace(
|
||||||
|
"{{Reading}}", "{{kana:Reading}}")
|
||||||
|
else:
|
||||||
|
t[k] = t[k].replace(
|
||||||
|
"{{Reading}}", "{{furigana:Reading}}")
|
||||||
# adjust css
|
# adjust css
|
||||||
if t['bg'].lower() == "#ffffff":
|
if t['bg'].lower() == "#ffffff":
|
||||||
# a bit more intuitive default
|
# a bit more intuitive default
|
||||||
|
|
Loading…
Reference in a new issue