lesjoursfr / html-to-epub

Generate EPUB books from HTML with simple API in Node.js.
MIT License
39 stars 16 forks source link

Allow `start` attribute #140

Open crutchcorn opened 3 months ago

crutchcorn commented 3 months ago

Hey all! I'm wanting to use this project to generate a physical edition of my book but found that I cannot support the start attribute of the <ol> tag:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol#start

I found this missing from this list:

https://github.com/lesjoursfr/html-to-epub/blob/main/src/index.ts#L29

I'd love to add it to the defaults, but maybe I could also add a configuration to overwrite this list with a default also exported so you can add to it (or replace it entirely).

What do y'all think?

e-adrien commented 3 months ago

Hi. Thank you for the PR. I really appreciate your work on this project.

I don't mind adding the start attribute to the default list. I just need to check before if the generated book will pass EPUBCheck for both v2 & v3 formats.

crutchcorn commented 3 months ago

Au contraire - I deeply appreciate your organization's work in maintaining this package.

So this is interesting, start attribute doesn't seem to throw errors, but there appears to be some problems with the cover in the validator:

↳  java -jar C:\Users\crutchcorn\Downloads\epubcheck-5.1.0\epubcheck-5.1.0\epubcheck.jar .\framework-field-guide-fundamentals.epub
Validating using EPUB version 3.3 rules.
ERROR(OPF-074): ./framework-field-guide-fundamentals.epub/OEBPS/content.opf(38,81): Package resource "OEBPS/cover.xhtml" is declared in several manifest item.
ERROR(OPF-014): ./framework-field-guide-fundamentals.epub/OEBPS/cover.xhtml(-1,-1): The property "svg" should be declared in the OPF file.
ERROR(OPF-014): ./framework-field-guide-fundamentals.epub/OEBPS/cover.xhtml(-1,-1): The property "svg" should be declared in the OPF file.

Check finished with errors
Messages: 0 fatals / 3 errors / 0 warnings / 0 infos

EPUBCheck completed

Let me see if I can make some PRs to correct this

crutchcorn commented 3 months ago

https://github.com/lesjoursfr/html-to-epub/pull/143

Fixes for the aforementioned issues here