mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-29 22:37:16 +01:00
Dont use zero offset for element selections
This commit is contained in:
parent
366a69a3cd
commit
d2db909851
1 changed files with 1 additions and 1 deletions
|
|
@ -793,7 +793,7 @@ def pos(container, offset):
|
|||
nt = container.nodeType
|
||||
if nt is Node.TEXT_NODE or nt is Node.CDATA_SECTION_NODE or nt is Node.COMMENT_NODE:
|
||||
return container, offset
|
||||
if nt is Node.ELEMENT_NODE:
|
||||
if nt is Node.ELEMENT_NODE and offset and container.childNodes.length > offset:
|
||||
return container.childNodes[offset], 0
|
||||
return container, offset
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue