arobase-che / remark-attr

Remark plugin to add support for custom attributes
Other
58 stars 16 forks source link

ATX-style cannot specify attributes if the header has inline syntax #24

Open akabekobeko opened 3 years ago

akabekobeko commented 3 years ago

ATX-style cannot specify attributes if the header has inline syntax.

Markdown:

# Header 1 {#header-1}

# Header 2
{#header-2}

# Header 3 **with text** {#header-3}

Expected:

<h1 id="header-1">Header 1</h1>
<h1 id="header-2">Header 2</h1>
<h1 id="header-3">Header 3 <strong>with text</strong></h1>

Actual:

<h1 id="header-1">Header 1</h1>
<h1 id="header-2">Header 2</h1>
<h1>Header 3 <strong>with text</strong> {#header-3}</h1>

{# header-3} remains as text content.

arobase-che commented 3 years ago

Hi \o

Looks like a bug to me.

The project need a total factorization since remark 13.

It will definitively be a new test case. Thank You !