Fix crash and add support for content in <div> (#9)

* fix #8: better regex to remove html entities
* add opf and ncx debug
* make epub content retrieval more flexible
* fix epub content retrieval: also support html files with <div>
This commit is contained in:
T.v.Dein
2025-10-19 22:30:13 +02:00
committed by GitHub
parent 2c6e81a2c8
commit cb671b7401
3 changed files with 75 additions and 23 deletions

View File

@@ -22,6 +22,7 @@ import (
"path/filepath"
"strings"
"github.com/alecthomas/repr"
"github.com/tlinden/epuppy/pkg/epub"
)
@@ -57,6 +58,11 @@ func ViewEpub(conf *Config) (int, error) {
return 0, err
}
if conf.Debug {
repr.Println(book.Files())
repr.Println(book.Ncx)
}
buf := strings.Builder{}
head := strings.Builder{}
@@ -78,6 +84,10 @@ func ViewEpub(conf *Config) (int, error) {
return fmt.Println(buf.String())
}
if conf.Debug {
return 0, nil
}
return Pager(&Ebook{
Config: conf,
Title: head.String(),