There are lots of subtle syntax variants that most people would also accept, but which may score better at compatibility. Several ones of them could be supported, others forbidden. Some alternatives play better with info strings of fenced code blocks, others with current or proposed link syntax.
Meta data inside curly braces
-
## Heading {#ID .class}
-
## Heading ## {#ID .class}
-
## Heading {#ID .class} ##
-
## {#ID .class} Heading
-
{#ID .class} ## Heading
-
{#ID .class}
## Heading
-
{#ID .class}
## Heading ##
-
## Heading
{#ID .class}
-
## Heading ##
{#ID .class}
-
Heading {#ID .class}
-------
-
{#ID .class} Heading
-------
-
Heading
------- {#ID .class}
-
Heading
{#ID .class} -------
Meta data (only) separated by line affix
-
## Heading ## #ID .class
-
#ID .class ## Heading ##
-
#ID .class ## Heading
-
#ID ## Heading ## .class
-
.class ## Heading ## #ID
-
Heading
------- #ID .class
Explicit IDs by reusing link (definition) syntax
-
[ID]
## Heading
-
[ID]:
## Heading
-
## Heading [][ID]
-
## [][ID] Heading
-
## [Heading][ID]
-
## Heading
[][ID]
-
[][ID]
## Heading
-
## Heading …
[Heading]: ID
-
## Heading …
[Heading]: #ID
-
## Heading …
[#Heading]: ID
-
## Heading …
[#Heading]: #ID
-
## Heading …
[Heading]: [ID]
-
## [Heading] …
[Heading]: ID
-
## [Heading] …
[Heading]: #ID
-
## [Heading] …
[#Heading]: ID
-
## [Heading] …
[#Heading]: #ID
-
## [Heading] …
[Heading]: [ID]
I’m probably forgetting some possibilities and proposals.