I take notes in Markdown as [gists](https://gist.github.com/) on GitHub. The web editor for GitHub is pretty good, does excellent code formatting, and has some other web niceties. Plus all my stuff stays in one place.
I'm a little biased with this workflow because I wrote an iOS client that lets you manage notes as GitHub gists. If this flow sounds attractive you can check OctoNote out here: https://apps.apple.com/us/app/octonote/id1433164731