Skip to content

Commit 6a4798e

Browse files
committed
(fix) comparative mode
1 parent 7381514 commit 6a4798e

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2024-12-25 -- v0.9.5
2+
-- Fixed issue with comparative mode
3+
14
2024-12-23 -- v0.9.4
25
-- Updated for compliance with python-negar 1.2.12
36
-- Fixed wheel event

negar_gui/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import platform
22
from pathlib import Path
33

4-
__version__ = "0.9.4"
4+
__version__ = "0.9.5"
55

66
APPDATA = "AppData/Roaming/" if platform.system() == "Windows" else "."
77
SETTING_FILE = Path.home() / f"{APPDATA}negar-gui/settings.toml"

negar_gui/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,13 @@ def edit_text(self, text=None):
856856
self.cleaned_text = persian_editor.cleanup()
857857
if self.comparative_output_chkbox.isChecked():
858858
colorized_text = Redlines(
859-
self.input_editor.toPlainText().strip().replace("\n", "<br>"),
860-
self.cleaned_text.strip().replace("\n", "<br>"),
859+
re.sub(r"\s*?\n", " <br> ", self.input_editor.toPlainText().strip()),
860+
self.cleaned_text.strip().replace("\n", " <br> "),
861861
)
862862
try:
863-
self.output_editor.append(colorized_text.output_markdown)
863+
self.output_editor.append(
864+
re.sub(r"\s*?<br>\s*?", "<br>", colorized_text.output_markdown) # noqa: COM812
865+
)
864866
except: # noqa: E722
865867
pass
866868
else:

0 commit comments

Comments
 (0)