diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index 4754110d..abf3c122 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -203,9 +203,10 @@ class GuiDocHighlighter(QSyntaxHighlighter): # Build a QRegExp for spell checker # Include additional characters that the highlighter should # consider to be word separators - wordSep = "_+" + wordSep = "_\+" + wordSep += nwUnicode.U_ENDASH wordSep += nwUnicode.U_EMDASH - self.spellRx = QRegularExpression("\\b[^\\s%s]+\\b" % wordSep) + self.spellRx = QRegularExpression(r"\b[^\s"+wordSep+r"]+\b") self.spellRx.setPatternOptions(QRegularExpression.UseUnicodePropertiesOption) return True