diff --git a/CHANGES b/CHANGES index 3250ea2..34a43f7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,10 @@ 0.14.3 August xx, 1996 - refactored boilerplate stripping for txt files so it only needs to be done once per book. boilerplate is now detected in the text Parser, instead of in the text Writer. +- support HTML5 `time` element. fixes #332 - `a` tags can't contain block tags in xhtml, so div in `a` and `p` in `a` cause EPUB2 validation errors, so Ebookmaker now changes `p` and `div` occurring in `a` to `span` for EPUB2. I'm not sure why anyone would want to use this markup in a book. Fixes #333 + 0.14.2 July 4, 2026 - `text-decoration` for `a` should be reset to `underline`, not initial. Fixes #316. diff --git a/README.md b/README.md index 47cb00a..6c5d97e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Ebookmaker is the tool used for format conversion at Project Gutenberg. It builds HTML5, EPUB2, EPUB3 and Kindle files (including KF8) from HTML. -It builds builds thes formats and PDF files from reST sources. +It builds these formats and PDF files from reST sources. If you are preparing HTML for use with Ebookmaker, the [Usage Notes](USAGE.md) may be of interest. diff --git a/src/ebookmaker/writers/EpubWriter.py b/src/ebookmaker/writers/EpubWriter.py index 6043855..e586347 100644 --- a/src/ebookmaker/writers/EpubWriter.py +++ b/src/ebookmaker/writers/EpubWriter.py @@ -1047,7 +1047,8 @@ def fix_html5(xhtml): attrs_to_remove = [('*', 'role'), ('*', 'itemid'), ('*', 'itemprop'), ('*', 'itemref'), ('*', 'itemscope'), - ('*', 'itemtype'), ('ol', 'start'), ('li', 'value'), ('*', 'focusable')] + ('*', 'itemtype'), ('ol', 'start'), ('li', 'value'), ('*', 'focusable'), + ('time', 'datetime')] svgattrs_to_remove = [('*', 'role'), ('*', 'focusable')] @@ -1092,7 +1093,7 @@ def fix_html5(xhtml): writers.HTMLWriter.add_class(block, f'{tag}_{blocktag}') # replace html5 inline tags - for newtag in ['u', 'ruby', 'rt', 'rp']: + for newtag in ['u', 'ruby', 'rt', 'rp', 'time']: for tag in xpath(xhtml, f'//xhtml:{newtag}'): usedtags.add(newtag) tag.tag = NS.xhtml.span diff --git a/tests/files/43172/43172-h/43172-h.html b/tests/files/43172/43172-h/43172-h.html index d92962e..ea4bf1c 100644 --- a/tests/files/43172/43172-h/43172-h.html +++ b/tests/files/43172/43172-h/43172-h.html @@ -382,9 +382,9 @@
-Quella che si suole chiamare Rivoluzione dell'89, +Quella che si suole chiamare Rivoluzione dell'89, , non fu che una grande rivolta e un grande -delitto politico che servì ad aumentare una triste +delitto politico che servì ad aumentare una triste serie di comuni delitti; per cui chi vuol trattare dei suoi elementi criminosi dovrebbe rifarne tutta la storia; il che nè è mio cómpito, nè sarebbe