From c7201b0c3a7cd4431aa04af7847ded735c107f23 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 10 Jun 2019 09:41:29 +1000 Subject: [PATCH] prefix non-breaking spaces https://anki.tenderapp.com/discussions/ankidesktop/34512-first-space-is-omitted-when-pasting --- aqt/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index 2c6dafee0..ca9abc986 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -945,7 +945,7 @@ class EditorWebView(AnkiWebView): # if there's more than one consecutive space, # use non-breaking spaces for the second one on def repl(match): - return " " + match.group(1).replace(" ", " ") + return match.group(1).replace(" ", " ") + " " txt = re.sub(" ( +)", repl, txt) return txt