From 31604a0cd2e6a226bd8748cd2a6568bac97655bd Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 8 Nov 2025 14:52:22 +1100 Subject: [PATCH] Fix newline after URL keeps URL formatting --- CHANGELOG.md | 4 ++++ bouquin/editor.py | 6 ++++++ pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f3262f..203a3f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.12.1 + + * Fix newline after URL keeps URL style formatting + # 0.1.12 * Add find bar for searching for text in the editor diff --git a/bouquin/editor.py b/bouquin/editor.py index e3f7133..ee45921 100644 --- a/bouquin/editor.py +++ b/bouquin/editor.py @@ -690,6 +690,12 @@ class Editor(QTextEdit): self._apply_normal_typing() # make the *new* paragraph Normal for typing return + # If we were at end-of-line, make the *new* line plain (don’t keep URL styling) + if not c.hasSelection() and c.atBlockEnd(): + super().keyPressEvent(e) # insert the new paragraph + self._break_anchor_for_next_char() # clear anchor/underline/color for typing + return + # otherwise default handling return super().keyPressEvent(e) diff --git a/pyproject.toml b/pyproject.toml index 8a41b6a..11c5a6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bouquin" -version = "0.1.12" +version = "0.1.12.1" description = "Bouquin is a simple, opinionated notebook application written in Python, PyQt and SQLCipher." authors = ["Miguel Jacq "] readme = "README.md"