There appears to be something amiss with the most recent installed version of Pandoc (pandoc 1.13.2.1) on my machines. With the previously installed version, conversion from markdown to plain text would generate 'Setext-style headers---'=' for H1 and '-' for H2---
in plain text output. In addition, I have noticed two more iffy issues:
I have spent the last few minutes playing around with different pandoc options with little luck.
How do I convert Illustration #1 to Illustration #3
Environment pandoc (pandoc 1.13.2.1) Kubuntu 15.10
Illustration #1: Input markdown file
# Title
## Section
* This is the section.
### Subsection
* This happens to be the subsection
Illustration #2: Output plain text after run pandoc -f markdown -t plain pandoc_markdown_issue.md
TITLE
Section
- This is the section.
Subsection
- This happens to be the subsection
Illustration #3: Desired Output
Title
=====
Section
-------
- This is the section.
Subsection
----------
- This happens to be the subsection
The plain text writer was changed to use the general format of Project Gutenberg plain text books. Of course, no choice will please everyone. For the sample you give, using the markdown writer would work well.
I'm able to achieve your desired output by leaving out the -f
and -t
flags altogether and letting Pandoc infer the conversion format from the output filename extension:
pandoc file.md -o file.txt
Alternatively, using -t plain
also seems to work:
pandoc -f markdown -t plain file.md -o file.txt
Not really sure why the first example works. My guess would be it's one of the markdown readers, since there are multiple.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With