mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix extra spaces being inserted into TOC title when reading TOC from OPD guide element. Fixes #8569 (Chapters headers with internal tags not added to TOC correctly.)
This commit is contained in:
parent
559ff8c59f
commit
c9bb59a5d5
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@
|
|||
import cssutils
|
||||
|
||||
from calibre.ebooks.oeb.base import OPF1_NS, OPF2_NS, OPF2_NSMAP, DC11_NS, \
|
||||
DC_NSES, OPF
|
||||
DC_NSES, OPF, xml2text
|
||||
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES, OEB_IMAGES, \
|
||||
PAGE_MAP_MIME, JPEG_MIME, NCX_MIME, SVG_MIME
|
||||
from calibre.ebooks.oeb.base import XMLDECL_RE, COLLAPSE_RE, \
|
||||
|
|
@ -423,7 +423,7 @@ def _toc_from_html(self, opf):
|
|||
path, frag = urldefrag(href)
|
||||
if path not in self.oeb.manifest.hrefs:
|
||||
continue
|
||||
title = ' '.join(xpath(anchor, './/text()'))
|
||||
title = xml2text(anchor)
|
||||
title = COLLAPSE_RE.sub(' ', title.strip())
|
||||
if href not in titles:
|
||||
order.append(href)
|
||||
|
|
|
|||
Loading…
Reference in a new issue