Make Markdown escaping in MS Teams integration messages nicer on the MS Teams mobile app.

Review Request #13892 — Created May 22, 2024 and submitted — Latest diff uploaded

Information

rbintegrations
release-4.x

Reviewers

We use Markdown links in our MS Teams integration messages, for example we
display the summary line of a review request and make it link to the review
request page. Since the text for some links are user supplied, we want to
escape Markdown characters in the text so that they don't break the link.

Originally we had used Djblets' markdown_escape function to escape all
Markdown characters, but this turned out to look bad on the MS Teams mobile
app. The app has a bug where they don't properly display escaped Markdown
characters. The backslashes that are used for escaping are just plainly show.
Luckily, brackets are the only characters that are properly escaped in the
app, and these are really the only ones that would break the Markdown link.
So now we only escape the brackets.

  • Tested sending messages where the summary contained characters
    that would break the Markdown link. Saw the messages appear correctly
    with working links in the mobile and desktop apps.
  • Ran unit tests.

Commits

Files