0

If I export a document from Markdown to html in Emacs it does not preserve line breaks. This is typical Markdown behavior. So,

Let the bird of loudest lay
On the sole Arabian tree
Herald sad and trumpet be,
To whose sound chaste wings obey.

is exported as

Let the bird of loudest lay On the sole Arabian tree Herald sad and trumpet be, To whose sound chaste wings obey.

Is there a setting that will preserve these breaks as there is in Org mode: (setq org-export-preserve-breaks t)

I don't like to manually insert double spaces at the end of the line.

3
  • 1
    I don't know, but in markdown you can indent things by 4 spaces to make it a code block, which should definitely retain line breaks when exported. That may or may not be a reasonable solution in your case.
    – phils
    Commented Aug 23 at 11:00
  • 1
    Why use Markdown? Write it in Org mode using a verse environment and export to markdown (or to HTML directly and cut out the middle man).
    – NickD
    Commented Aug 23 at 14:00
  • 1
    This question is about Markdown. Emacs just invokes some backend (eg pandoc) to convert Markdown file to HTML format.
    – shynur
    Commented Aug 26 at 20:25

1 Answer 1

2

markdown-mode uses an external utility to export markdown (defined in markdown-command.) You'll need to find, install, and configure a utility that does what you want. Otherwise you'll need to use two-or-more spaces, or a block quote as suggested.

1
  • 2
    markdown-command can also be a function name, so you could write your own exporter in elisp.
    – nega
    Commented Aug 25 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.