I've heard of Obsidian, and I heard pretty good stuff about it on HN, but the fact it's based on Electron sort of steers me away from it.
See if https://ghostwriter.kde.org/ (FOSS) helps? Source code is at https://github.com/KDE/ghostwriter (written in C++)