public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* md-docx-md rountripping not working
@ 2018-12-23 21:55 Denis Maier
       [not found] ` <de0093bf-6f3a-45cc-be5b-02764dd126bd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Maier @ 2018-12-23 21:55 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 2178 bytes --]

I have tested if I can convert a docx produced with pandoc back to markdown 
after making a few changes in the docx. Normal paragraphs, blockquotes, 
headings and footnotes work fine. However, author, title, and date end up 
as normal paragraphs in the resulting markdown file, whereas the original 
source had a yaml metadata block.

I have this file (test.md) and use `pandoc test.md -o test.docx`

```
---
author: Author
title: Test
date: Dezember 2018
---

Heading
=======

Test Test Test
```

I can then convert the resulting docx to pandoc's native format:

```
Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str 
"Author"]),("date",MetaInlines [Str "Dezember",Space,Str 
"2018"]),("title",MetaInlines [Str "Test"])]})
[Header 1 ("heading",[],[]) [Str "Heading"]
,Div ("",[],[("custom-style","FirstParagraph")])
 [Para [Str "Test",Space,Str "Test",Space,Str "Test"]]]
```

Now, after making one small edit converting this to pandoc's native format 
(`pandoc test.docx -f docx+styles -t native) gives me:

```
Pandoc (Meta {unMeta = fromList []})
[Div ("",[],[("custom-style","Titel")])
 [Para [Str "Test"]]
,Div ("",[],[("custom-style","Author")])
 [Para [Str "Author"]]
,Div ("",[],[("custom-style","Datum")])
 [Para [Str "Dezember",Space,Str "2018"]]
,Header 1 ("heading",[],[]) [Str "Heading"]
,Div ("",[],[("custom-style","FirstParagraph")])
 [Para [Str "Test",Space,Str "Test",Space,Str "Test.",Space,Str 
"Another",Space,Str "Test."]]]
```

What is going wrong here? As you can see my change was trivial and occured 
not in the metadata. Nevertheless, we end up with different styles.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/de0093bf-6f3a-45cc-be5b-02764dd126bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 3315 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-25 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-23 21:55 md-docx-md rountripping not working Denis Maier
     [not found] ` <de0093bf-6f3a-45cc-be5b-02764dd126bd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-12-24 11:32   ` BP Jonsson
2018-12-25 15:38     ` Denis Maier
     [not found]       ` <5157c829-b27c-4e8c-83b3-44e227c0a637-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-12-25 23:59         ` BP Jonsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).