mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +02:00
fix toc
This commit is contained in:
parent
9cf733b553
commit
e79cd346c4
@ -37,12 +37,18 @@ func (e *ePub) getToc(title string, images []*Image) string {
|
||||
link := t.CreateElement("a")
|
||||
link.CreateAttr("href", img.TextPath())
|
||||
link.CreateText(path)
|
||||
paths[currentPath] = t
|
||||
paths[currentPath] = t.CreateElement("ol")
|
||||
}
|
||||
}
|
||||
|
||||
if len(ol.ChildElements()) == 1 && e.StripFirstDirectoryFromToc {
|
||||
ol = ol.ChildElements()[0]
|
||||
ol = ol.FindElement("/li/ol")
|
||||
}
|
||||
|
||||
for _, v := range ol.FindElements("//ol") {
|
||||
if len(v.ChildElements()) == 0 {
|
||||
v.Parent().RemoveChild(v)
|
||||
}
|
||||
}
|
||||
|
||||
beginning := etree.NewElement("li")
|
||||
|
Loading…
x
Reference in New Issue
Block a user