From 6ed0ec5a706afee485bb261a302755d36d781831 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 May 2014 12:17:22 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/editor/smart/html.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tweak_book/editor/smart/html.py b/src/calibre/gui2/tweak_book/editor/smart/html.py index f1afc51af2..1bd6116b83 100644 --- a/src/calibre/gui2/tweak_book/editor/smart/html.py +++ b/src/calibre/gui2/tweak_book/editor/smart/html.py @@ -318,12 +318,12 @@ class HTMLSmarts(NullSmarts): containing tag. ''' block = cursor.block() offset = cursor.position() - block.position() - block, boundary = next_tag_boundary(block, offset, forward=False) - if block is None: + nblock, boundary = next_tag_boundary(block, offset, forward=False) + if nblock is None: return None, None if boundary.is_start: # We are inside a tag, use this tag - start_block, start_offset = block, boundary.offset + start_block, start_offset = nblock, boundary.offset else: tag = find_closest_containing_tag(block, offset) if tag is None: