mirror of
https://codeberg.org/scip/epuppy.git
synced 2025-12-16 20:11:00 +01:00
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:
10
cmd/view.go
10
cmd/view.go
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user