From 3799b8504fca2373bc5e9972662b01c35bf43409 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Tue, 24 Mar 2020 11:54:19 +0100 Subject: [PATCH 1/2] strip to test whether field is empty --- qt/aqt/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 31c5d3b8f..77e89ac77 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -496,9 +496,10 @@ class Editor: return True m = self.note.model() for c, f in enumerate(self.note.fields): + f = f.replace("
", "").strip() notChangedvalues = {"", "
"} if previousNote and m["flds"][c]["sticky"]: - notChangedvalues.add(previousNote.fields[c]) + notChangedvalues.add(previousNote.fields[c].replace("
", "").strip()) if f not in notChangedvalues: return False return True From c1a8c413b003787614787fa4f8a9858a3b2424c3 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Tue, 24 Mar 2020 12:26:48 +0100 Subject: [PATCH 2/2] remove space in fields --- qt/ts/src/editor.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qt/ts/src/editor.ts b/qt/ts/src/editor.ts index 890e884b0..eea5fd8c5 100644 --- a/qt/ts/src/editor.ts +++ b/qt/ts/src/editor.ts @@ -352,9 +352,7 @@ function setFields(fields) { oncut='onCutOrCopy(this);' contentEditable=true class=field - > -${f} - + >${f} `; }