How to stop pandoc from escaping characters?

Viewed 1216

Suppose I want to use pandoc to convert between markdown flavors:

$ echo "# Header #1" | pandoc -t markdown

I get the following output with the #1 escaped:

Header \#1
==========

How do I prevent pandoc from doing this?

1 Answers

You can pipe the output to sed like this to remove \

$ echo "# Header #1" | pandoc -t markdown | sed 's/\\//g'

I know this is not a perfect solution, but it works if your document does not contain \ char.

Related