emacsorphanage / ox-pandoc

Another org-mode exporter via pandoc.
GNU General Public License v2.0
48 stars 13 forks source link

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

Open aminevsaziz opened 2 years ago

aminevsaziz commented 2 years ago

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?

a-fent commented 1 year ago

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.

aminevsaziz commented 1 month ago

@a-fent I hope you are doing well. Just curious any progress on this issue? No update about it!