mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Replace functionality of mungeHTML with call to new gui_hook
This commit is contained in:
parent
7f9e560396
commit
4720645d1c
1 changed files with 6 additions and 3 deletions
|
@ -420,9 +420,7 @@ class Editor:
|
|||
print("uncaught cmd", cmd)
|
||||
|
||||
def mungeHTML(self, txt):
|
||||
if txt in ("<br>", "<div><br></div>"):
|
||||
return ""
|
||||
return txt
|
||||
return gui_hooks.editor_will_munge_html(txt, self)
|
||||
|
||||
# Setting/unsetting the current note
|
||||
######################################################################
|
||||
|
@ -1201,4 +1199,9 @@ def fontMungeHack(font):
|
|||
return re.sub(" L$", " Light", font)
|
||||
|
||||
|
||||
def munge_html(txt, editor):
|
||||
return "" if txt in ("<br>", "<div><br></div>") else txt
|
||||
|
||||
|
||||
gui_hooks.editor_will_use_font_for_field.append(fontMungeHack)
|
||||
gui_hooks.editor_will_munge_html.append(munge_html)
|
||||
|
|
Loading…
Reference in a new issue