Had the same problems with a VitePress site, using VSCode as editor including the included linters / link checkers.
[toc]:/ [[toc]]
... did the trick for me.