From 8adda0c4a98af2c014d27c5ea7664fcbe5db23fe Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 13 Jun 2020 00:14:34 +0200 Subject: [PATCH] Fix regexes to be exclusive for 1, 2 and 3 stars --- nw/core/tohtml.py | 4 ++-- nw/core/tokenizer.py | 14 +++++++------- nw/gui/dochighlight.py | 6 +++--- sample/nwProject.nwx | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/nw/core/tohtml.py b/nw/core/tohtml.py index 61541f42..f58c1a7a 100644 --- a/nw/core/tohtml.py +++ b/nw/core/tohtml.py @@ -121,8 +121,8 @@ class ToHtml(Tokenizer): self.FMT_B_E : "", self.FMT_I_B : "", self.FMT_I_E : "", - self.FMT_U_B : "", - self.FMT_U_E : "", + self.FMT_S_B : "", + self.FMT_S_E : "", } if self.isNovel and self.genMode != self.M_PREVIEW: diff --git a/nw/core/tokenizer.py b/nw/core/tokenizer.py index 70599d59..1335ed23 100644 --- a/nw/core/tokenizer.py +++ b/nw/core/tokenizer.py @@ -44,8 +44,8 @@ class Tokenizer(): FMT_B_E = 2 # End bold FMT_I_B = 3 # Begin italics FMT_I_E = 4 # End italics - FMT_U_B = 5 # Begin underline - FMT_U_E = 6 # End underline + FMT_S_B = 5 # Begin bold italic + FMT_S_E = 6 # End bold italic T_EMPTY = 1 # Empty line (new paragraph) T_SYNOPSIS = 2 # Synopsis comment @@ -300,14 +300,14 @@ class Tokenizer(): # RegExes for adding formatting tags within text lines # Keep in sync with the DocHighlighter class rxFormats = [( - QRegularExpression(r"(? - + Sample Project Sample Project Jane Smith Jay Doh - 313 - 47 - 5934 + 319 + 49 + 9675 False True True 636b6aa9b697b - 14298de4d9524 + 636b6aa9b697b 921 B @@ -117,7 +117,7 @@ 1202 217 7 - 469 + 248 Another Scene