There is documentation here: https://doc.qt.io/qt-6/qsyntaxhighlighter.html with a simple example (not markdown). Also, Qt is open source, so at a push you could get the code, take a look and create your own. A good place to start might be here: https://github.com/qt/qtbase/blob/dev/src/gui/text/qtextmarkdownimporter.cpp