mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 17:20:47 +08:00
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.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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>
|
||||
```
|
||||
Reference in New Issue
Block a user