mirror of
https://codeberg.org/scip/epuppy.git
synced 2025-12-17 04:20:59 +01:00
fix XML parsing (#2)
- Use antchfx/xmlquery for easier XML parsing. No more regexp wrangling and the result is much more reliable over a variety of ebooks. Much good. - fix chapter selection, look for `<?xml[...]` which is much more reliable - add option `-x` to dump the XML ebook source for debugging
This commit is contained in:
@@ -16,8 +16,7 @@ type Book struct {
|
||||
Container Container `json:"-"`
|
||||
Mimetype string `json:"-"`
|
||||
Content []Content
|
||||
|
||||
fd *zip.ReadCloser
|
||||
fd *zip.ReadCloser
|
||||
}
|
||||
|
||||
// Open open resource file
|
||||
@@ -34,11 +33,6 @@ func (p *Book) Files() []string {
|
||||
return fns
|
||||
}
|
||||
|
||||
// Close close file reader
|
||||
func (p *Book) Close() error {
|
||||
return p.fd.Close()
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
func (p *Book) filename(n string) string {
|
||||
return path.Join(path.Dir(p.Container.Rootfile.Path), n)
|
||||
|
||||
Reference in New Issue
Block a user