add furigana to decks on upgrade

This commit is contained in:
Damien Elmes 2012-04-07 18:28:31 +09:00
parent 5d3e31ca5d
commit e5bf86c40e

View file

@ -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