wcember / pypub

Python library to programatically create epub files
MIT License
278 stars 44 forks source link

mdash / ndash not supported - fix available #26

Open clach04 opened 1 year ago

clach04 commented 1 year ago

Get fatal errors. Should map:

Found in issue #24

This is enough to cause truncation and unexpected behaviors in Adobe Digital Editions Version 4.5.11.187303

clach04 commented 1 year ago

Test case:

# demo for https://github.com/wcember/pypub

import pypub

my_first_epub = pypub.Epub('mdash_demo')
my_first_chapter = pypub.create_chapter_from_string(u'<p>Hello\u2014World</p>', title='mdash Chapter')
my_first_epub.add_chapter(my_first_chapter)
my_first_epub.create_epub('OUTPUT_DIRECTORY')
clach04 commented 1 year ago

Possibly another manifestation of https://github.com/wcember/pypub/issues/18 ?

clach04 commented 1 year ago
(py27venv) C:\code\py\pypub\pypub>java -jar C:\Programs\epubcheck-5.1.0\epubcheck.jar OUTPUT_DIRECTORY\mdashdemo.epub
Validating using EPUB version 2.0.1 rules.
FATAL(RSC-016): OUTPUT_DIRECTORY/mdashdemo.epub/OEBPS/ch000.xhtml(9,16): Fatal Error while parsing file: The entity "mdash" was referenced, but not declared.

Check finished with errors
Messages: 1 fatal / 0 errors / 0 warnings / 0 infos

EPUBCheck completed