Skip to content

Enhance EPUB writer to support multiple EPUB versions and improve HTML format detection.#11628

Merged
jgm merged 4 commits into
jgm:mainfrom
vreoo:fix-8880-raw-format-aliases
May 17, 2026
Merged

Enhance EPUB writer to support multiple EPUB versions and improve HTML format detection.#11628
jgm merged 4 commits into
jgm:mainfrom
vreoo:fix-8880-raw-format-aliases

Conversation

@vreoo
Copy link
Copy Markdown
Contributor

@vreoo vreoo commented May 7, 2026

Added checks for EPUB format variants and updated transformation functions to accommodate versioning. Introduced tests for raw EPUB attributes rendering.

…L format detection.

Added checks for EPUB format variants and updated transformation functions to accommodate versioning. Introduced tests for raw EPUB attributes rendering.
Comment thread test/command/8880.md Outdated
Comment on lines +18 to +27
% pandoc -f native -t epub --metadata title=Raw -o - | pandoc -f epub -t html
[ RawBlock (Format "epub") "<p>ok</p>" ]
^D
<p><span id="title_page.xhtml"></span></p>
<p><span id="ch001.xhtml"></span></p>
<section id="ch001.xhtml_raw" class="unnumbered level1">
<h1 class="unnumbered">Raw</h1>
<p>ok</p>
</section>
```
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this test adds anything to the yreceding one. They both test the same thing on the writer side. Maybe just use this one (which doesn't also test the markdown reader) and omit the first one?
However, it would be good to ADD a test that shows that content marked epub2 is omitted for epub3 output (for example).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 329ad27

I removed the redundant first positive test and kept the native -> epub writer-side check, and added a negative case showing that content marked epub2 is omitted from epub3 output, while keeping epub3 case.

@vreoo vreoo requested a review from jgm May 17, 2026 05:41
Comment thread test/command/8880.md Outdated
Raw EPUB2 attributes are omitted from EPUB3 output.

```
% pandoc -f markdown -t epub3 --metadata title=Raw -o - | pandoc -f epub -t html | grep ok
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The | grep ok is not needed; just make sure the output is right. We don't want to assume that grep is installed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, it's done in f8a61dd

@jgm jgm merged commit 0640c4c into jgm:main May 17, 2026
6 of 10 checks passed
@jgm
Copy link
Copy Markdown
Owner

jgm commented May 17, 2026

thanks!

smc181002 pushed a commit to smc181002/pandoc that referenced this pull request May 29, 2026
This change ensures that raw content marked `epub2` will appear in (only) EPUBv2 output
and content marked `epub3` will appear in (only) EPUBv3 output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants