Drafts Newbie Trying to Send Text

I’m still a relative newbie to drafts, I just got the pro version.

Is there a way to:

  1. Write in Markdown
  2. Send to text message

But have the content free of the Markdown content?

There’s not any specific features for stripping Markdown. I admit to not recalling a request for that before.

I full-fledged tool to strip any Markdown might be a bit tricky to write. If you are just wanting to strip a few common Markdown things it would likely not be too hard to create a script that cleaned up the text with regular expressions.

That said, I don’t recall seeing any examples already existing.

What are you looking to strip exactly? Maybe with some examples I could help.

I believe this should do it.

The approach is as follows:

  1. Take the Markdown content of the draft and render that to HTML.
  2. Takes a copy of any text on the clipboard.
  3. Put a rich text version of the HTML on the clipboard.
  4. Get the text of the clipboard (plain, not rich).
  5. Restore the original clipboard text.
  6. Set a template tag to the new plain text we have and use that as the body of the message.

A Note on Text Layout
Please note that you must write in Markdown for this. I know that sounds silly given the request. However, when you go through this rendering process, if you find you are missing blank lines or lines running on from one another, that is not the script. That is the Markdown missing key aspects to enforce such layout.

Show off :wink:

Clever though and I appreciate that for sure.