Can pandoc preserve whitespace when converting RTF to MD? #10335
GeoffreyPlitt
started this conversation in
General
Replies: 4 comments 4 replies
-
Maybe you could replace all whitespaces with non-breakable spaces? However, another problem with this kind of formatting is that the exact placement of the letters will depend on the font used…
|
Beta Was this translation helpful? Give feedback.
1 reply
-
The RTF reader attempts to figure out what is a "code block" and will translate that into a code block (with spacing preserved). Everything else will be treated as reflowable paragraph content. The way it detects code is by looking at the font. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Non-breaking spaces sounds interesting... except this isn't a line-wrap issue.
I don't understand what “except” implies here. You can try it yourself:
pandoc -f rtf -t markdown <<< 'normal spaces'
normal spaces
pandoc -f rtf -t markdown <<< 'non-breaking spaces'
non-breaking spaces
|
Beta Was this translation helpful? Give feedback.
1 reply
-
If editing the RTF in a "word processor" is an option might replacing it with a table be an option? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Pandoc to convert an RTF doc to an MD for a musical chord chart. The whitespace is important, because the chords need to align with the lyrics. I've attached the example RTF (input) and MD (output) that I got, using this command:
cat chart.rtf | pandoc --from=rtf --to=markdown > out.md
The whitespace is not preserved correctly. Adding "--wrap=preserve" does not make a difference. Is there a way to preserve the whitespace?
chart.rtf.zip
out.md
Beta Was this translation helpful? Give feedback.
All reactions