Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions src/ebookmaker/writers/EpubWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')]

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/files/43172/43172-h/43172-h.html
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@ <h2 class="x-ebookmaker-important">
</h2>
<h3 class="subhead" title="Omelets ]with Liqueur">Just testing</h3>
<p>
Quella che si suole chiamare Rivoluzione dell'89,
Quella che si suole chiamare Rivoluzione dell'89, <time datetime="1971-07-04">my birthday</time>,
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
Expand Down