8000 Formatting removed from figure captions when DOCX converted to Markdown · Issue #10758 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Formatting removed from figure captions when DOCX converted to Markdown #10758
Closed
@rrthomas

Description

@rrthomas

If I put some of a caption in emphasis, then convert to DOCX with pandoc 3.6.4, then convert back to Markdown, the emphasis is lost, sort of.

Example, saved as foo.md:

![Foo *emphasis*](media/image.jpg)

Conversion command:

pandoc --to=docx foo.md --output=foo.docx

Screenshot of docx:

Image

It looks like the emphasis is lost here, but it clearly isn't, because if I try converting back to Markdown with the following command:

pandoc --to=markdown-raw_html foo.docx --output=bar.md

I get this in bar.md:

:::: figure
![Foo emphasis](./media/rId20.jpg){width="5.833333333333333in"
height="7.583576115485564in"}

::: caption
Foo *emphasis*
:::
::::

So it seems that the emphasis is lost in the image link, but not in the actual caption.

If I don't use -raw_ 525E html, then the emphasis kept in the figcaption element produced:

<figure>
<img src="media/rId20.jpg" style="width:5.83333in;height:7.58358in"
alt="Foo emphasis" />
<figcaption aria-hidden="true"><p>Foo <em>emphasis</em></p></figcaption>
</figure>

It may be that this problem is fixed by 2155b5f

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0