remarkjs/remark

Thematic break after image is parsed as an heading level 2

Closed this issue · 3 comments

Initial checklist

Affected packages and versions

15

Link to runnable example

https://stackblitz.com/edit/github-3xaefk?file=src%2Fmain.ts

Steps to reproduce

The following

![](../../assets/images/logos/cdk.png)
---

is parsed as

## ![](../../assets/images/logos/cdk.png)

Expected behavior

Don't add an heading block

Actual behavior

An heading block is added and the horizontal rule is removed

Runtime

Node v16

Package manager

No response

OS

No response

Build and bundle tools

No response

Hey @remorses! 👋
Sorry you ran into some confusion.

That is not a bug, CommonMark has two ways to generate headers ATX and SETEXT.

This example is a SETEXT heading

![](../../assets/images/logos/cdk.png)
---

This example is an ATX heading

## ![](../../assets/images/logos/cdk.png)

both are valid and expected.

See https://commonmark.org/help/ and https://spec.commonmark.org/0.30/#setext-headings for more information.

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

Thank you, commonmark is full of surprises!