Fix removing code block metadata on delete
This commit is contained in:
parent
9ab70c76f8
commit
a4e44643a6
1 changed files with 4 additions and 2 deletions
|
|
@ -445,6 +445,8 @@ class MarkdownEditor(QTextEdit):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
open_block, close_block = bounds
|
open_block, close_block = bounds
|
||||||
|
fence_block_num = open_block.blockNumber()
|
||||||
|
|
||||||
doc = self.document()
|
doc = self.document()
|
||||||
if doc is None:
|
if doc is None:
|
||||||
return False
|
return False
|
||||||
|
|
@ -468,8 +470,8 @@ class MarkdownEditor(QTextEdit):
|
||||||
# Clear language metadata for this block, if supported
|
# Clear language metadata for this block, if supported
|
||||||
if hasattr(self, "_code_metadata"):
|
if hasattr(self, "_code_metadata"):
|
||||||
clear = getattr(self._code_metadata, "clear_language", None)
|
clear = getattr(self._code_metadata, "clear_language", None)
|
||||||
if clear is not None:
|
if clear is not None and fence_block_num != -1:
|
||||||
clear(open_block.blockNumber())
|
clear(fence_block_num)
|
||||||
|
|
||||||
# Refresh visuals (spacing + backgrounds + syntax)
|
# Refresh visuals (spacing + backgrounds + syntax)
|
||||||
if hasattr(self, "_apply_code_block_spacing"):
|
if hasattr(self, "_apply_code_block_spacing"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue