mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Add newlines
This commit is contained in:
parent
ee3d4f5ad8
commit
17f23221e4
1 changed files with 3 additions and 0 deletions
|
@ -1199,14 +1199,17 @@ def fontMungeHack(font):
|
||||||
def munge_html(txt, editor):
|
def munge_html(txt, editor):
|
||||||
return "" if txt in ("<br>", "<div><br></div>") else txt
|
return "" if txt in ("<br>", "<div><br></div>") else txt
|
||||||
|
|
||||||
|
|
||||||
def remove_null_bytes(txt, editor):
|
def remove_null_bytes(txt, editor):
|
||||||
# misbehaving apps may include a null byte in the text
|
# misbehaving apps may include a null byte in the text
|
||||||
return txt.replace("\x00", "")
|
return txt.replace("\x00", "")
|
||||||
|
|
||||||
|
|
||||||
def reverse_url_quoting(txt, editor):
|
def reverse_url_quoting(txt, editor):
|
||||||
# reverse the url quoting we added to get images to display
|
# reverse the url quoting we added to get images to display
|
||||||
return editor.mw.col.media.escapeImages(txt, unescape=True)
|
return editor.mw.col.media.escapeImages(txt, unescape=True)
|
||||||
|
|
||||||
|
|
||||||
gui_hooks.editor_will_use_font_for_field.append(fontMungeHack)
|
gui_hooks.editor_will_use_font_for_field.append(fontMungeHack)
|
||||||
gui_hooks.editor_will_munge_html.append(munge_html)
|
gui_hooks.editor_will_munge_html.append(munge_html)
|
||||||
gui_hooks.editor_will_munge_html.append(remove_null_bytes)
|
gui_hooks.editor_will_munge_html.append(remove_null_bytes)
|
||||||
|
|
Loading…
Reference in a new issue