Coder Social home page Coder Social logo

epub-parser's People

Contributors

dependabot[bot] avatar fauu avatar gaoxiaoliangz avatar jpfong avatar mariusa avatar sbatson5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

epub-parser's Issues

"GeneralObject" and "HtmlNodeObject" unrecognized with TypeScript

Hi,
When I try to use the package with typescript, tsc says that "GeneralObject" and "HtmlNodeObject" unrecognized.
Changing those type to "any" works for me - but there is one problem:
I want to deploy my work on Heroku, and I cannot do so because it downloads the package itself.
I fixed it by changing the package and adding it to my code (not under the node_modules folder)
Just wanted to ask you if you think there is a better solution :)
Thank you!

info.authors is string instead of array

A book can have multiple authors. info.authors should be an array of authors, not string.

example from xml:

<dc:creator opf:role="aut" opf:file-as="Santa &amp; Smith, John">Santa Claus</dc:creator>
<dc:creator opf:role="aut">John Smith</dc:creator>

Image not found.

All images in my epub cannot be found when running toHTMLObjects(). Here's a screenshot. I even tried editing the epub, but it didnt fixed the problem.

Annotation 2019-12-20 162047

Here's the sample epub. Just rename the extension to epub.
sample_book.zip

angular2

heve a problem with importing in ionic-angualr2

sectionId are undefined in the structure array

I tried with several .epub from www.bibebook.com. The IDs are always undefined

image

the file I'm using for exemple:

http://www.bibebook.com/files/ebook/libre/V2/dumas_alexandre_-_le_docteur_mysterieux_i.epub

I'm using the library in a Vue component:

      <v-col>
          <v-file-input v-model="file" accept=".epub" label="File input"></v-file-input>
          <v-btn v-if="filePresent" @click="handleRead">Lire</v-btn>
        </v-col>

    ...
    private handleRead() {
    const reader = new FileReader();
    reader.onload = evt => {
      parseEpub(evt.target!.result as Buffer)
        .then((res: Epub) => this.setBook(res))
        .catch((err: Error) => window.alert(err.message));
    };
    reader.readAsArrayBuffer(this.file);
  }
  private setBook(b: Epub) {
    this.book = b;
    console.log(this.book);
  }

errorMessage": "Cannot read property 'href' of undefined (toc attribute not found in spine?)

Hello @gaoxiaoliangz,

I have encountered the following error while parsing an ePub:

errorMessage": "Cannot read property 'href' of undefined", "errorType": "TypeError", "stackTrace": [ "TypeError: Cannot read property 'href' of undefined", " at Epub.<anonymous> (/Users/xx/Desktop/workspaces/xxx/node_modules/@gxl/epub-parser/src/parseEpub.ts:185:52)",

I think that the above issue might be because of the toc attribute not being found in the <spine /> tag. I've tried removing the unused attribute in the .opf file, and replaced it with the expected toc attribute, and I did not have the error anymore.

The ePub 3.2 specifications points out the toc attribute is optional in the <spine />. Instead of breaking, shouldn't it advisable to continue the parsing process when the attribute is not found ?

Thanks in advance @gaoxiaoliangz for your reply and keep up the good work ๐Ÿ˜Š

Deprecated dependency to-markdown

One of the packages you depend on is out of date.

warning @gxl/epub-parser > [email protected]: to-markdown has been renamed to Turndown, with a new API. Please update to turndown v4.0.0 or above and see the migration guide for details: https://github.com/domchristie/turndown/wiki/Migrating-from-to-markdown-to-Turndown

โฏ yarn add @gxl/epub-parser
yarn add v1.19.1
[1/4] ๐Ÿ”  Resolving packages...
warning @gxl/epub-parser > [email protected]: to-markdown has been renamed to Turndown, with a new API. Please update to turndown v4.0.0 or above and see the migration guide for details: https://github.com/domchristie/turndown/wiki/Migrating-from-to-markdown-to-Turndown
warning @gxl/epub-parser > to-markdown > jsdom > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ”จ  Building fresh packages...
success Saved lockfile.
success Saved 11 new dependencies.
info Direct dependencies
โ””โ”€ @gxl/[email protected]
info All dependencies
โ”œโ”€ @gxl/[email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ”œโ”€ [email protected]
โ””โ”€ [email protected]
โœจ  Done in 13.04s.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.