How to create different heading levels in lang-markdown

I’m new to CM6 and having problems with getting the lang-markdown module to distinguish between different levels of headings. All levels seem to be mapped to t.heading instead of t.heading1, t.heading2 etc. How would I extend the language to achieve that?

The example below shows that both the # and ## headers have the same ͼy class associated:

<div class="cm-line">
    <span class="ͼy ͼ11">#</span>
    <span class="ͼy"> main</span>
</div>

<div class="cm-line">
    <span class="ͼy ͼ11">##</span>
    <span class="ͼy"> second level heading</span>
</div>

As of @codemirror/lang-markdown 0.17.3, headings emit the appropriate heading1 to heading6 tag, which highlight styles can target to apply different styling.

2 Likes