Get 'Make Rich Text from Markdown' to preserve originial paragraphing

Hello, I have a shortcut which takes a draft document and turns it into an email. It’s useful because I can have it send group or personalised emails to people from a filtered contact list. At the moment, though the paragraphing gets removed. So this:

Hello Tom,

This is a new paragraph

Thanks

Becomes this:

Hello Tom,
This is a new paragraph
Thanks

Is there a way to preserve the blank lines?

The shortcut is here:
Thanks

Try leaving two spaces at the end of every paragraph, in addition to the blank line between them. It’s part of the Markdown standard to force a new line.

You can also use a backslash \ instead of the double spaces.

1 Like

Maybe this would help: Text Workflow — gTrigonakis

Is the shortcut removing the paragraphing? Is the paragraphing removed with the generated markdown. Or is the paragraphing removed when you process the markdown ?

Marked 2 has an option to preserve line breaks in paragraphs when markdown is processed - ie: you would not need the double space and enter.

I’ve also had this problem. Two spaces at the end of a line doesn’t help either.

Works for me when I pull from a Markdown file using iA Writer’s Get action:

I couldn’t get it to work when pulling from Drafts no matter what I did—it just kept giving me the title of the Draft, nothing else.

1 Like

This is the difference between plain text and rich text. Markdown is a plain text format which uses visible markup (including whitespace) to represent structure. However, in rich text, the markup is invisible to the user. Therefore, when Markdown is converted to a rich text format (including HTML), the markup also becomes invisible.

When rendered to rich text, each Markdown paragraph is still a separate rich text paragraph. However, the blank lines no longer exist as they become the now-invisible markup. Instead, you would need to use the styles native to the specific markup format to add space between paragraphs. In HTML this would require some CSS rules. In TextEdit this would involve adjusting Paragraph Spacing. Each tool and/or file format has its own way of configuring this.

It seems that Apple’s Mail.app does not include any configuration options for that. However, some have reported success formatting the text in a rich text editor and then copying and pasting that into Mail.app. Others have found third-party email apps which include configuration options for this in their compose window. YMMV.

1 Like

Thanks everyone.

I’ve managed to fix the paragraphing - @waylan, your advice was very helpful.

A regex search for \n and replacing it with \n\n restores the blank lines following the make rich text action. It doesn’t fix the problem of text not being bolded or underlined though - I suspect this is a problem with drafts not integrating with shortcuts. I’ll check on the drafts forum to see if there is a solution there…

Thanks again