Files
nibras shami 0640c4c985 EPUB writer: support multiple EPUB versions for raw content (#11628).
This change ensures that raw content marked `epub2` will appear in (only) EPUBv2 output
and content marked `epub3` will appear in (only) EPUBv3 output.
2026-05-17 11:02:34 +02:00

1.0 KiB

Raw EPUB attributes are rendered in EPUB output.

% 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>

Raw EPUB2 attributes are omitted from EPUB3 output.

% pandoc -f markdown -t epub3 --metadata title=Raw -o - | pandoc -f epub -t html
~~~ {=epub2}
<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>
</section>
% pandoc -f markdown -t epub3 --metadata title=Raw -o - | pandoc -f epub -t html
~~~ {=epub3}
<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>