How to extend Markdown mode?

I’m in a process of rewriting my old AngularJS Notes app that had a syntax like this:

--------------------------------------------------------------------------------
:: Header
--------------------------------------------------------------------------------

They are text based notes and I parse the code to find all the headers and render them in the UI so you can navigate inside a long note.

Now after rewrite I decided to use Markdown (with CodeMirror), but I’ve kept the dashes. So the new syntax look like this:

--------------------------------------------------------------------------------
## Header
--------------------------------------------------------------------------------

But the dashes do nothing. They just separators so the headers stand out when you scan the note with your eyes.

Now the problem is that it don’t work with Markdown syntax highlighting.

If I have link before the dash, the URL is white and dashes are also in different color:

https://metalgrowlmastery.com/products/brutal-growl-starter-kit
--------------------------------------------------------------------------------
## header
--------------------------------------------------------------------------------

I need to press enter after the link for the proper syntax highlighting.

How hard it would be to modify or extend the markdown mode, to add dashes into the syntax, so the highlighting is stable.

If you Markdown supports this syntax for headers:

Heading level 2
---------------

Can it be removed without modification of the source code? I think that it detects the URL as a header.

Yes, it can. See the remove field in the parser extension interface. The construct you’re looking to disable is called "SetextHeading". Look up how you can pass parser extensions to @codemirror/lang-markdown’s markdown function.

The construct you’re looking to disable is called "SetextHeading"

Where can I find all the features that I can disable?