There are three things to consider.
What Markdown is allowed?
What BBCode is allowed?
What HTML is allowed?
All 3 can be mixed and merged to some extent.
Our implementation uses Markdown-it.
You can see a complete interactive list of the formatting syntax here: https://markdown-it.github.io/
We support a subset of “common” BBCode.
As for what BBCode is supported, the best place to look is the tests (
[b]strong[/b] [i]emphasis[/i] [u]underlined[/u] [s]strikethrough[/s] [ul][li]option one[/li][/ul] [quote="eviltrout"][/quote] [img]http://eviltrout.com/eviltrout.png[/img] [url]http://bettercallsaul.com[/url] [email]email@example.com[/email] [code]\nx++\n[/code]
Custom BBCode specific to Discourse, needed for functions that don’t fit into Markdown, but do fit into BBCode.
[spoiler]it's a sled[/spoiler] [quote="eviltrout, post:1, topic:2"]
Markdown specifies that it works seamlessly with HTML, so we do.
However, we only support a “safe” subset of HTML.
See the list of supported tags and attributes here: discourse/allow-lister.js at main · discourse/discourse · GitHub