marked icon indicating copy to clipboard operation
marked copied to clipboard

wrong h3 indentation after bullet point

Open wischi-chr opened this issue 7 years ago • 8 comments

The following markdown is not rendered correctly

# Indentation Test

### Header 1
  - Bulletpoint 1
### Header 2 <---
  - Bulletpoint 2

On github it looks like this: https://gist.github.com/wischi-chr/dc48d7957e80fb4e2024f7f304489ced correct_markdown

but it's rendered like that:

wrong_markdown

wischi-chr avatar Feb 11 '18 13:02 wischi-chr

Believe this is related to new lines and possible regex - believe you would see the same behavior from the original Daring Fireball implementation as well. Can you try the following:

### Header 1

- Bulletpoint 1

### Header 2

- Bulletpoint 2

joshbruce avatar Feb 11 '18 14:02 joshbruce

Thanks for the workaround.

Is it considered a bug or is that intentional?

wischi-chr avatar Feb 12 '18 19:02 wischi-chr

This is the "proper" way to write Markdown, according to the original definition - this differentiates between block-level elements of different types.

https://daringfireball.net/projects/markdown/basics

Having said that, it looks like the CommonMark spec, it would be classified as a defect.

Do you know if you are using the pedantic setting on Marked? Or, the CommonMark or GFM settings?

joshbruce avatar Feb 12 '18 20:02 joshbruce

I'm not 100% sure (on mobile right now) but I think I've tried pedantic (and tried a couple of different options with markdown-viewer)

wischi-chr avatar Feb 12 '18 22:02 wischi-chr

Pedantic = Original Daring Fireball spec. So, probably should use the blank lines.

Otherwise, we’ve marked it for consideration and further discussion.

joshbruce avatar Feb 13 '18 12:02 joshbruce

I confirm, marked currently produces

<h1 id="indentation-test">Indentation Test</h1>
<h3 id="header-1">Header 1</h3>
<ul>
  <li>
    Bulletpoint 1
    <h3 id="header-2-">Header 2 &lt;---</h3>
  </li>
  <li>Bulletpoint 2</li>
</ul>

whereas commonmark 0.28

<h1>Indentation Test</h1>
<h3>Header 1</h3>
<ul>
  <li>Bulletpoint 1</li>
</ul>
<h3>Header 2 &lt;---</h3>
<ul>
  <li>Bulletpoint 2</li>
</ul>

This is most probably relative to the list rule. #982

Feder1co5oave avatar Feb 15 '18 21:02 Feder1co5oave

I have the same problem. Is this issue fixed?

zhuyangbing avatar Mar 02 '18 03:03 zhuyangbing

@zhuyangbing: Feder1co5oave recently stepped away from the project for a while. There's only four of us right now and none of us have the level of knowledge regarding the library that he did. We are also reconsidering our priorities to ensure we don't keep burning out our highest performers.

If you can help solve the problem, we should be able to get it into the next release; otherwise, please be patient as we figure some stuff out. Thank you.

joshbruce avatar Mar 02 '18 13:03 joshbruce

fixed

UziTech avatar Sep 10 '22 04:09 UziTech