Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong h3 indentation after bullet point #1047

Closed
wischi-chr opened this issue Feb 11, 2018 · 9 comments
Closed

wrong h3 indentation after bullet point #1047

wischi-chr opened this issue Feb 11, 2018 · 9 comments
Labels
category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue parser: CommonMark

Comments

@wischi-chr
Copy link

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

@joshbruce
Copy link
Member

joshbruce commented Feb 11, 2018

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

@wischi-chr
Copy link
Author

Thanks for the workaround.

Is it considered a bug or is that intentional?

@joshbruce
Copy link
Member

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 joshbruce added L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue parser: CommonMark labels Feb 12, 2018
@wischi-chr
Copy link
Author

wischi-chr commented Feb 12, 2018

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)

@joshbruce
Copy link
Member

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

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

@Feder1co5oave
Copy link
Contributor

Feder1co5oave commented Feb 15, 2018

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

@zhuyangbing
Copy link

I have the same problem. Is this issue fixed?

@joshbruce
Copy link
Member

@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.

@UziTech
Copy link
Member

UziTech commented Sep 10, 2022

fixed

@UziTech UziTech closed this as completed Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue parser: CommonMark
Projects
None yet
Development

No branches or pull requests

5 participants