Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandoc stripping <p> from <figcaption> #5576

Closed
machal opened this issue Jun 12, 2019 · 1 comment
Closed

Pandoc stripping <p> from <figcaption> #5576

machal opened this issue Jun 12, 2019 · 1 comment

Comments

@machal
Copy link

machal commented Jun 12, 2019

I'm curious why Pandoc removes <p> from <figcaption>.

My original HTML:

<figure>
  <img src="image.jpg" alt="">
  <figcaption>
    <p><em>Caption…</em></p>
  </figcaption>
</figure>

Then I run:

pandoc -o target.epub source.html --from=html+raw_html --to=epub

EPUB's HTML then looks like:

<figure>
  <img src="image.jpg" alt="">
  <figcaption>
    <em>Caption…</em>
  </figcaption>
</figure>

My Pandoc version:

$ pandoc --version
pandoc 2.7.2
Compiled with pandoc-types 1.17.5.4, texmath 0.11.2.2, skylighting 0.7.7
@mb21
Copy link
Collaborator

mb21 commented Jun 12, 2019

Pandoc currently does not support block elements (like <p>) as figure captions. Closing in favour of #3177.

btw. if you only want to do html to epub (which is basically just a zipped html bundle), you'll probably get better results with another tool than pandoc, e.g. calibre. From our manual:

Because pandoc’s intermediate representation of a document is less expressive than many of the formats it converts between, one should not expect perfect conversions between every format and every other. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc’s simple document model. While conversions from pandoc’s Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc’s Markdown can be expected to be lossy.

@mb21 mb21 closed this as completed Jun 12, 2019
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

No branches or pull requests

2 participants