Take a look at Standard Notes. It is privacy focussed with encryption but has markdown and code editors and can be self hosted
- Bullets with multiple indents going from 1 to 1) a. etc - Table handling - Usual formatting like heading levels etc
And there seem to be lots of flavours of markdown too, just to add another layer to things.