Added unicode constants class, and support for non-breaking spaces, which aren't preserved on save.
This commit is contained in:
@@ -16,6 +16,8 @@ import nw
|
||||
from PyQt5.QtCore import Qt, QRegularExpression
|
||||
from PyQt5.QtGui import QColor, QTextCharFormat, QFont, QSyntaxHighlighter, QBrush
|
||||
|
||||
from nw.constants import nwUnicode
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
@@ -87,6 +89,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
"strike" : self._makeFormat(self.colEmph, "strike"),
|
||||
"underline" : self._makeFormat(self.colEmph, "underline"),
|
||||
"trailing" : self._makeFormat(self.colTrail,"background"),
|
||||
"nobreak" : self._makeFormat(self.colTrail,"background"),
|
||||
"dialogue1" : self._makeFormat(self.colDialN),
|
||||
"dialogue2" : self._makeFormat(self.colDialD),
|
||||
"dialogue3" : self._makeFormat(self.colDialS),
|
||||
@@ -145,6 +148,13 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
}
|
||||
))
|
||||
|
||||
# Non-breaking Space
|
||||
self.hRules.append((
|
||||
"[\u00a0]+", {
|
||||
0 : self.hStyles["nobreak"],
|
||||
}
|
||||
))
|
||||
|
||||
# Markdown
|
||||
self.hRules.append((
|
||||
r"(?<![\w|\\])([\*]{2})(?!\s)(?m:(.+?))(?<![\s|\\])(\1)(?!\w)", {
|
||||
|
||||
Reference in New Issue
Block a user