From 013b737452728ef40320f149fb008bc950ffa816 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 12 Jun 2020 22:47:13 +0200 Subject: [PATCH] Updated syntax highlighter --- nw/gui/dochighlight.py | 62 +++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index afd5a77c..812aca06 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -98,28 +98,28 @@ class GuiDocHighlighter(QSyntaxHighlighter): self.colTrail.setAlpha(64) self.hStyles = { - "header1" : self._makeFormat(self.colHead, "bold",1.8), - "header2" : self._makeFormat(self.colHead, "bold",1.6), - "header3" : self._makeFormat(self.colHead, "bold",1.4), - "header4" : self._makeFormat(self.colHead, "bold",1.2), - "header1h" : self._makeFormat(self.colHeadH,"bold",1.8), - "header2h" : self._makeFormat(self.colHeadH,"bold",1.6), - "header3h" : self._makeFormat(self.colHeadH,"bold",1.4), - "header4h" : self._makeFormat(self.colHeadH,"bold",1.2), - "bold" : self._makeFormat(self.colEmph, "bold"), - "italic" : self._makeFormat(self.colEmph, "italic"), - "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), - "replace" : self._makeFormat(self.colRepTag), - "hidden" : self._makeFormat(self.colComm), - "keyword" : self._makeFormat(self.colKey), - "modifier" : self._makeFormat(self.colMod), - "value" : self._makeFormat(self.colVal), + "header1" : self._makeFormat(self.colHead, "bold", 1.8), + "header2" : self._makeFormat(self.colHead, "bold", 1.6), + "header3" : self._makeFormat(self.colHead, "bold", 1.4), + "header4" : self._makeFormat(self.colHead, "bold", 1.2), + "header1h" : self._makeFormat(self.colHeadH, "bold", 1.8), + "header2h" : self._makeFormat(self.colHeadH, "bold", 1.6), + "header3h" : self._makeFormat(self.colHeadH, "bold", 1.4), + "header4h" : self._makeFormat(self.colHeadH, "bold", 1.2), + "bold" : self._makeFormat(self.colEmph, "bold"), + "italic" : self._makeFormat(self.colEmph, "italic"), + "strike" : self._makeFormat(self.colEmph, "strike"), + "bolditalic" : self._makeFormat(self.colEmph, ("bold","italic")), + "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), + "replace" : self._makeFormat(self.colRepTag), + "hidden" : self._makeFormat(self.colComm), + "keyword" : self._makeFormat(self.colKey), + "modifier" : self._makeFormat(self.colMod), + "value" : self._makeFormat(self.colVal, "underline"), } self.hRules = [] @@ -139,6 +139,13 @@ class GuiDocHighlighter(QSyntaxHighlighter): )) # Markdown + self.hRules.append(( + r"(?