ox-pandoc icon indicating copy to clipboard operation
ox-pandoc copied to clipboard

#+ATTR_HTML etc : Why the output of ox-pandoc is different from using Pandoc CLI

Open aminevsaziz opened this issue 2 years ago • 1 comments

recently i discovered these issues with ox-pandoc/pandoc, where the org buffer need to be exported to temporary org file using pandoc and then convert it again using pandoc CLI! this behavior in fact lead to loss of style information. here an org example

* Text with custom style 
#+attr_html: :custom-style Sender
#+begin_text
Page 6
#+end_text

* other stuff
@@pandoc: <div custom-style="Sender">Page X</div>@@

running this org example using any ox-pandoc exporter in emac (e.g org-pandoc-export-to-markdown) will generate the following output:

---
author: Bla Bla
---

# Text with custom style

::: text
Page 6
:::

# other stuff

\<div custom-style=\"Sender\"\>Page X\</div\>

Suprisingly, using Pandoc CLI (e.g pandoc -f org -t markdown test.org -o test.md) show the following results:

# Text with custom style

::: {.text custom-style="Sender"}
Page 6
:::

# other stuff

` <div custom-style="Sender">Page X</div>`{=pandoc}

why cant we keep the the information regarding custom-style for example?

aminevsaziz avatar Oct 24 '22 04:10 aminevsaziz

Thanks for the report, and sorry that I missed the notification. The reason is the org-to-org conversion in ox-pandoc, which is needed to support e.g. code blocks.

I'm aware of the issue with #+ATTR_HTML etc. but I haven't yet been able to work out exactly how such elements are parsed and represented by Org mode in order to preserve and pass them on to pandoc.

a-fent avatar Jan 21 '23 16:01 a-fent