More markdown tests
All checks were successful
CI / test (push) Successful in 5m12s
Lint / test (push) Successful in 31s
Trivy / test (push) Successful in 23s

This commit is contained in:
Miguel Jacq 2025-11-30 16:30:46 +11:00
parent 95b7d828b5
commit 3b3087cc37
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
2 changed files with 974 additions and 1 deletions

View file

@ -118,9 +118,12 @@ class MarkdownEditor(QTextEdit):
)
def setDocument(self, doc):
super().setDocument(doc)
# Recreate the highlighter for the new document
# (the old one gets deleted with the old document)
if doc is None:
return
super().setDocument(doc)
if hasattr(self, "highlighter") and hasattr(self, "theme_manager"):
self.highlighter = MarkdownHighlighter(
self.document(), self.theme_manager, self
@ -214,6 +217,9 @@ class MarkdownEditor(QTextEdit):
if doc is None:
return
if not hasattr(self, "highlighter") or self.highlighter is None:
return
bg_brush = self.highlighter.code_block_format.background()
selections: list[QTextEdit.ExtraSelection] = []