diff --git a/CHANGELOG.md b/CHANGELOG.md index e7956bc3..2a2a3e11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # novelWriter Changelog +## Version 1.5.2 [2021-12-12] + +### Release Notes + +This is a bugfix release that fixes two issues. The first is an issue with an error in the HTML +output if a paragraph has alignment or indentation tags while at the same time containing +emphasised text. The second is an issue where the application cannot load a project with spell +checking enabled if there is something wrong with the spell check package. + +### Detailed Changelog + +**Bugfixes** + +* When the HTML converter replaced grater than or smaller than symbols with the corresponding HTML + entities. the poisition of the formatting tags following in the text would be shifted, but the + positions were not updated. This is now solved by updating these positions when such a symbol is + encountered. This issue has been backported from 1.6 development. Issue #929. +* If the pyenchant package is installed, but the underlying enchant library is broken in one way or + another, the pyenchant package will error, causing novelWriter to crash. All calls to the + pyenchant package has now been wrapped in try/except blocks to prevent this. Issue #933. + +---- + ## Version 1.5.1 [2021-10-23] ### Release Notes diff --git a/novelwriter/assets/text/release_notes.htm b/novelwriter/assets/text/release_notes.htm index 186cf844..1fde313b 100644 --- a/novelwriter/assets/text/release_notes.htm +++ b/novelwriter/assets/text/release_notes.htm @@ -2,6 +2,18 @@ +

Release Notes for 1.5.2

+

Released on 12 December 2021

+ +

This is a bugfix release that fixes two issues. The first is an issue with an error in the HTML +output if a paragraph has alignment or indentation tags while at the same time containing +emphasised text. The second is an issue where the application cannot load a project with spell +checking enabled if there is something wrong with the spell check package.

+ +

See also the Releases page.

+ +
+

Release Notes for 1.5.1

Released on 23 October 2021

@@ -10,8 +22,6 @@ missing its translated labels for non-English languages, and a fix concerning sw the project tree when the Novel tab is visible. If the Novel tab is selected, the focus shift now correctly gives focus to the Novel tree.

-

See also the Releases page.

-

Release Notes for 1.5

diff --git a/novelwriter/core/spellcheck.py b/novelwriter/core/spellcheck.py index 3679c964..53cdf11c 100644 --- a/novelwriter/core/spellcheck.py +++ b/novelwriter/core/spellcheck.py @@ -89,17 +89,26 @@ class NWSpellEnchant(): def checkWord(self, theWord): """Wrapper function for pyenchant. """ - return self._theDict.check(theWord) + try: + return self._theDict.check(theWord) + except Exception: + return True def suggestWords(self, theWord): """Wrapper function for pyenchant. """ - return self._theDict.suggest(theWord) + try: + return self._theDict.suggest(theWord) + except Exception: + return [] def addWord(self, newWord): """Add a word to the project dictionary. """ - self._theDict.add_to_session(newWord) + try: + self._theDict.add_to_session(newWord) + except Exception: + return False if self._projectDict is not None and newWord not in self._projDict: newWord = newWord.strip() diff --git a/tests/test_core/test_core_spell.py b/tests/test_core/test_core_spellcheck.py similarity index 92% rename from tests/test_core/test_core_spell.py rename to tests/test_core/test_core_spellcheck.py index 7d0df7cc..720d3e28 100644 --- a/tests/test_core/test_core_spell.py +++ b/tests/test_core/test_core_spellcheck.py @@ -48,6 +48,13 @@ def testCoreSpell_Enchant(monkeypatch, tmpDir): assert spChk.listDictionaries() == [] assert spChk.describeDict() == ("", "") + # Break the enchant package, and check error handling + spChk = NWSpellEnchant() + spChk.theDict = None + assert spChk.checkWord("word") is True + assert spChk.suggestWords("word") == [] + assert spChk.addWord("word") is False + # Load the proper enchant package (twice) spChk = NWSpellEnchant() spChk.setLanguage("en", wList)