At the risk of continuing to talk to myself, here’s a specific motivating example that we ran into today:
One of the cases where we use scripts to notify people of events is to mail developers when new PRs are merged to our GitHub repository. We’ve now changed these scripts to mail to a specific category on our Discourse site. However, since GitHub uses markdown to describe PRs, we often have section headers like the following in our PR descriptions:
Details of this PR
------------------
which get rendered as section headers on GitHub. But when mailed to Discourse, this line of dashes causes the rest of the message to get trimmed.
We could obviously train all our developers to use other styles of headers instead that would not be trimmed (like ## Details of this PR), but if there were some way for us to modify our script to process the merge message and protect or escape such patterns so that they would be preserved through into Discourse, that seems more attractive.