mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 13:17:12 -05:00
strip superfluous spans from 1.2 upgrade
This commit is contained in:
parent
e610eeeb42
commit
fca4ef7c00
1 changed files with 6 additions and 3 deletions
|
|
@ -465,9 +465,12 @@ order by ordinal""", mid)):
|
||||||
t[k] = re.sub("(^|[^{]){{([^{}]+)?}}", repl, t[k])
|
t[k] = re.sub("(^|[^{]){{([^{}]+)?}}", repl, t[k])
|
||||||
# then strip extra {}s from other fields
|
# then strip extra {}s from other fields
|
||||||
t[k] = t[k].replace("{{{", "{{").replace("}}}", "}}")
|
t[k] = t[k].replace("{{{", "{{").replace("}}}", "}}")
|
||||||
if "{{{" in t[k]:
|
# remove superfluous formatting from 1.0 -> 1.2 upgrade
|
||||||
print t[k]
|
t[k] = re.sub("font-size: ?20px;?", "", t[k])
|
||||||
raise Exception()
|
t[k] = re.sub("(?i)font-family: ?arial;?", "", 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('<span style=" *">(.+?)</span>', '\\1', t[k])
|
||||||
# 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