Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration options to enable / disable all validation checks #95

Open
vers-one opened this issue May 20, 2023 · 0 comments · Fixed by #120
Open

Configuration options to enable / disable all validation checks #95

vers-one opened this issue May 20, 2023 · 0 comments · Fixed by #120
Assignees

Comments

@vers-one
Copy link
Owner

vers-one commented May 20, 2023

Description

There are quite a few EPUB books that don't conform to the EPUB specification and thus fail parsing validations in EpubReader. Sometimes, it might be desirable to turn off some of those validations and ignore the parts of the book that couldn't be parsed.

Proposed solution

Go through all EPUB parsing validation checks and create configuration options (one per each check) to turn them on or off individually. For example, the value of the package/manifest/item/id attribute must be unique (otherwise it will be impossible to determine which manifest item is referenced in the spine). A new PackageReaderOptions.SkipManifestItemsWithDuplicateIds configuration property will instruct PackageReader whether it should skip duplicate manifest items or throw an exception.

Additionally, create three configuration presets:

  • STRICT — all validation checks are enabled;
  • RELAXED — ignore errors that are most common in the real-world EPUB books (default option);
  • IGNORE_ALL_ERRORS — turn off all validation checks and try to salvage as much data as possible.

Additional context

Some of those options are already implemented and documented here: https://os.vers.one/EpubReader/malformed-epub/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant