Edit book: Fix smart tag insert not working correctly if the selected text starts with the closing angle bracket of a tag

This commit is contained in:
Kovid Goyal 2023-09-22 13:33:55 +05:30
parent 2feb109fba
commit 6f6bd4b32f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -275,7 +275,7 @@ def ensure_not_within_tag_definition(cursor, forward=True):
if boundary.is_start: if boundary.is_start:
# We are inside a tag # We are inside a tag
if forward: if forward:
block, boundary = next_tag_boundary(block, offset) block, boundary = next_tag_boundary(block, max(0, offset-1))
if block is not None: if block is not None:
cursor.setPosition(block.position() + boundary.offset + 1) cursor.setPosition(block.position() + boundary.offset + 1)
return True return True