TLDR: It's a mess.
Back in the day, I started migrating notepad stuff to Markdown on a Wiki. Then on a MediaWiki. Then DokuWiki. Then ZimWiki. Then Joplin. Then GitHub Pages and a self-hosted Jeckyll.
Each, single, one, of, them, uses a slightly different flavor of Markdown. At this point, I have stuff spread over ALL OF THEM, much of it rotting away in "backups to migrate later". ๐ฎโ๐จ
I've been considering "vibe coding" some converters...
As for syncing... the Markdown part is easy: git.
Working with a Markdown editor to update GH Pages, was a good experience.
Having ZimWiki auto-sync to git, was good, but didn't find a decent compatible editor for Android.
I switched to Joplin lured by the built-in auto-sync options, but kind of regret it now, when it has a folder with thousands of files in it.
Obsidian is not OSS itself, but has an OSS plugin to sync to git.
I've read that using Logseq alongside Obsidian should be possible... and was planning to test that setup, keeping Obsidian in charge of sync. Possibly with GitHub/Jeckyll, git-lfs for images and attachments.
PS: assuming one could have working back-and-forth converters for the different Markdown flavors, and everything stored in git, then one could theoretically use git hooks to convert to/from whatever local version used by a particular editor.