Skip to content

wrong h3 indentation after bullet point #1047

Closed

Description

@wischi-chr

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

Activity

  1. joshbruce commented on Feb 11, 2018

    @joshbruce
    Member

    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
    
  2. wischi-chr commented on Feb 12, 2018

    @wischi-chr
    Author

    Thanks for the workaround.

    Is it considered a bug or is that intentional?

  3. joshbruce commented on Feb 12, 2018

    @joshbruce
    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?

  4. added
    L2 - annoying
    on Feb 12, 2018
  5. wischi-chr commented on Feb 12, 2018

    @wischi-chr
    Author

    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)

  6. joshbruce commented on Feb 13, 2018

    @joshbruce
    Member

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

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

  7. Feder1co5oave commented on Feb 15, 2018

    @Feder1co5oave
    Contributor

    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

  8. zhuyangbing commented on Mar 2, 2018

    @zhuyangbing

    I have the same problem. Is this issue fixed?

  9. joshbruce commented on Mar 2, 2018

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

  10. UziTech commented on Sep 10, 2022

    @UziTech
    Member

    fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 - annoyingcategory: listsparser: CommonMark

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions