AFAIK, it's Matrix markup, the idea is to make plaintext easy to extract, so you can send plaintext notifications, keep it simple. Markdown is fragile too for some reason. You can't use normal libraries with untrusted messages, because normal libraries work only with trusted data. HTML sanitization works like conversion between different formats.