Nested list rendering broken if line after is not empty

Steps to reproduce

Paste the following markdown into an Obsidian file:

- This is a new concept
    - This is nested {under} the concept
    - Much context is above me
        - Which is why this is the {case}
            - This is another item
<!--shouldn't affect rendering-->

Expected behaviour

Would render like this:

  • This is a new concept
    • This is nested {under} the concept
    • Much context is above me
      • Which is why this is the {case}
        • This is another item

Actual behaviour

Renders like this:

image

Environment

Windows 10, Obsidian 0.9.22

Additional information

I initially encountered this behaviour via an issue with my plugin. I’ve tested this behaviour in a few online markdown editors - StackEdit, Dillinger and markdowntohtml. None of them exhibit this behaviour. Even this forum’s own markdown parser doesn’t exhibit the behaviour!

I suspect the bug is the reason why this issue to do with block IDs and nested lists exists. Adding a newline seems to fix it according to the GitHub issue for my plugin, so there might be a way for me to hard-code this special case. But this feels like something that should be up to Obsidian to fix.

2 Likes

Thanks for the report. This is an interesting case. I am not sure if it’s our parser to blame. We’ll look into it.

Even if we fix this, nested lists and blockids won’t work properly.

1 Like

I wanna add that (sometimes) nested lists should be broken if the line after is not empty.

1 Like

I confirm that this is an upstream problem. Should get fixed once we migrate to remark 13 (it will take some time).

1 Like

The “Strict line breaks” is turned off. Software rebooted after this configuration.
Note: the ![[state_transition.png]] can be any figure.
What I want to point out is with/without a line break between the lists and the figure.

Steps to reproduce

Try this:

- aaa
    - aaa
        - aaa

       - aaa

        - aaa
            -  aaa 
![[state_transition.png]]

- aaa
    - aaa
        - aaa

       - aaa

        - aaa
            -  aaa

![[state_transition.png]]

- aaa
    - aaa
        - aaa
       - aaa
        - aaa
            -  aaa
![[state_transition.png]]

Expected result

I know that there are flaws in my markdown grammar. But the rendered result for the first one looks strange (please check out the image below).

Actual result

Environment

  • Operating system:
  • Obsidian version:
    0.9.22

Additional information

I know that I’m not using the standard markdown grammar. That’s kind of reason why I turn the strict line break thing on.

If there is any suggestion on how I should improve my markdown grammar, it is also very helpful. Thanks.

content

- Question1
    - Answer
<!--ID: 1610044657897-->

- Question2
    - Answer

Actual result

image

what I expected

image

Environment

windows 10 / obsidian v0.10.7


Additional information