mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 21:24:57 +02:00
Minor index fix, for entries with spaces
This commit is contained in:
parent
02ce48b451
commit
0cf3dc0545
1 changed files with 7 additions and 1 deletions
|
|
@ -26,7 +26,12 @@ def add_instr(self, elem):
|
|||
if not raw:
|
||||
return
|
||||
if self.name is None:
|
||||
self.name, raw = raw.strip().partition(' ')[0::2]
|
||||
# There are cases where partial index entries end with
|
||||
# a significant space, along the lines of
|
||||
# <>Summary <> ... <>Hearing<>.
|
||||
# No known examples of starting with a space yet.
|
||||
# self.name, raw = raw.strip().partition(' ')[0::2]
|
||||
self.name, raw = raw.lstrip().partition(' ')[0::2]
|
||||
self.buf.append(raw)
|
||||
|
||||
def finalize(self):
|
||||
|
|
@ -100,6 +105,7 @@ def __init__(self):
|
|||
|
||||
def __call__(self, doc, log):
|
||||
all_ids = frozenset(XPath('//*/@w:id')(doc))
|
||||
# import pydevd;pydevd.settrace()
|
||||
c = 0
|
||||
while self.index_bookmark_prefix in all_ids:
|
||||
c += 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue