preserve whitespace when pasting text

This commit is contained in:
Damien Elmes 2019-02-06 11:59:55 +10:00
parent 288ab2f8bf
commit 080118876a

View File

@ -938,7 +938,10 @@ class EditorWebView(AnkiWebView):
# normal text; convert it to HTML
txt = html.escape(txt)
txt = txt.replace("\n", "<br>")
txt = txt.replace("\n", "<br>")\
.replace("\t", " "*4)\
.replace(" ", "&nbsp;")
return txt
def _processHtml(self, mime):