Fix removing code block metadata on delete
Some checks failed
Lint / test (push) Waiting to run
Trivy / test (push) Waiting to run
CI / test (push) Has been cancelled

This commit is contained in:
Miguel Jacq 2025-11-29 16:41:02 +11:00
parent 9ab70c76f8
commit a4e44643a6
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9

View file

@ -445,6 +445,8 @@ class MarkdownEditor(QTextEdit):
return False
open_block, close_block = bounds
fence_block_num = open_block.blockNumber()
doc = self.document()
if doc is None:
return False
@ -468,8 +470,8 @@ class MarkdownEditor(QTextEdit):
# Clear language metadata for this block, if supported
if hasattr(self, "_code_metadata"):
clear = getattr(self._code_metadata, "clear_language", None)
if clear is not None:
clear(open_block.blockNumber())
if clear is not None and fence_block_num != -1:
clear(fence_block_num)
# Refresh visuals (spacing + backgrounds + syntax)
if hasattr(self, "_apply_code_block_spacing"):