diff --git a/aqt/editor.py b/aqt/editor.py index 8a9be8864..d564b2ad5 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -254,7 +254,6 @@ class Editor: return txt = urllib.parse.unquote(txt) txt = unicodedata.normalize("NFC", txt) - txt = self.mungeHTML(txt) # misbehaving apps may include a null byte in the text txt = txt.replace("\x00", "") # reverse the url quoting we added to get images to display @@ -286,10 +285,6 @@ class Editor: else: print("uncaught cmd", cmd) - def mungeHTML(self, txt): - txt = re.sub(r"
$", "", txt) - return txt - # Setting/unsetting the current note ###################################################################### diff --git a/web/editor.css b/web/editor.css index c8ff0d979..2562fa095 100644 --- a/web/editor.css +++ b/web/editor.css @@ -5,7 +5,9 @@ padding: 5px; overflow-wrap: break-word; } - +.field:empty:before { + content: "\00a0"; /* nbsp */ +} .clearfix:after { content: ""; display: table; diff --git a/web/editor.js b/web/editor.js index af950904e..f7ffb094e 100644 --- a/web/editor.js +++ b/web/editor.js @@ -87,11 +87,6 @@ function inPreEnvironment() { } function onInput() { - // empty field? - if (currentField.innerHTML === "") { - currentField.innerHTML = "
"; - } - // make sure IME changes get saved triggerKeyTimer(); } @@ -292,9 +287,6 @@ function setFields(fields) { for (var i = 0; i < fields.length; i++) { var n = fields[i][0]; var f = fields[i][1]; - if (!f) { - f = "
"; - } txt += "{0}".format(n); txt += "