From dd14a388894e5faf825f0dd023820d8023c9cda1 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 29 May 2020 20:38:46 +0200 Subject: [PATCH 1/3] An update to how text is extracted from the text editor, conforms to the description in the Qt docs. --- nw/constants/constants.py | 5 +++-- nw/gui/elements/doceditor.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/nw/constants/constants.py b/nw/constants/constants.py index 09622650..bc20af31 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -183,10 +183,11 @@ class nwQuotes(): # END Class nwQuotes class nwUnicode: - """Suppoted unicode character constants and translation maps. + """Suppoted unicode character constants and translation maps for HTML. """ # Unicode Constants + # ================= ## Quotation Marks U_QUOT = "\u0022" # Quotation mark @@ -216,7 +217,6 @@ class nwUnicode: ## Other U_NBSP = "\u00a0" # Non-breaking space - U_PARA = "\u2029" # Paragraph separator U_CHECK = "\u2714" # Heavy check mark U_MULT = "\u2715" # Multiplication x @@ -231,6 +231,7 @@ class nwUnicode: U_LTRIS = "\u25c2" # Left-pointing triangle, small # HTML Equivalents + # ================ ## Quotes H_QUOT = """ diff --git a/nw/gui/elements/doceditor.py b/nw/gui/elements/doceditor.py index 45058360..f3b1f5af 100644 --- a/nw/gui/elements/doceditor.py +++ b/nw/gui/elements/doceditor.py @@ -391,9 +391,13 @@ class GuiDocEditor(QTextEdit): uses QTextEdit->toPlainText for Qt versions lower than 5.9, and the QDocument->toRawText for higher version. The latter preserves non-breaking spaces, which the former does not. + We still want to get rid of page and line separators though. + See: https://doc.qt.io/qt-5/qtextdocument.html#toPlainText """ if self.mainConf.verQtValue >= 50900: - theText = self.qDocument.toRawText().replace(nwUnicode.U_PARA,"\n") + theText = self.qDocument.toRawText() + theText = theText.replace("\u2028", "\n") # Line separators + theText = theText.replace("\u2029", "\n") # Paragraph separators else: theText = self.toPlainText() return theText From 4de02698d9d3e24f039761add9633d8a675963ea Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 29 May 2020 20:40:29 +0200 Subject: [PATCH 2/3] Preferences doc size limit unit is kB, not kb --- nw/gui/dialogs/configeditor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nw/gui/dialogs/configeditor.py b/nw/gui/dialogs/configeditor.py index 77abc231..a088d090 100644 --- a/nw/gui/dialogs/configeditor.py +++ b/nw/gui/dialogs/configeditor.py @@ -573,7 +573,7 @@ class GuiConfigEditEditingTab(QWidget): "Big document limit", self.bigDocLimit, "Disables full spell checking over the size limit.", - theUnit="kb" + theUnit="kB" ) return From 5fe521d2e9df93513fd5b76cd8ff287e3954b5fc Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 29 May 2020 21:10:13 +0200 Subject: [PATCH 3/3] Updated changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7edf3f9b..750409b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # novelWriter ChangeLog +## Version 0.6.4 [2020-xx-xx] + +**User Interface** + +* Updated the unit for Preferences > Editor > Big document limit from `kb` to `kb`. Issue #258, PR #260. + + ## Version 0.6.3 [2020-05-28] **Bugfixes**