Nested list rendering broken / flattened 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.

7 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

We strongly recommend you to search the forum with possible keywords before submitting a new bug report. Please also try your repro steps with third-party plugins and custom CSS disabled and see if itā€™s still reproducible. If itā€™s an issue with third-party plugins or themes, try contacting the author for help. Once youā€™ve done the above, delete this line.

Steps to reproduce

Use this code

- Unresponsiveness
	-  Xenonintagonist NMDA receptors, 
		 - increase K+ conductance
			- high excitability
	-  Propofol: 
		- potentiates GABA-A receptors, 
		- High  inhibition			
Disociated consiousness:
		*  Ketamine 
			- antagonist NMDA receptoptors
			- increase availability of  synaptic Glutamate

Expected result

image

Actual result

Environment

  • Operating system:
  • Obsidian version:

Additional information

I am on Obsidian 0.11.3, I turned off the theme
Sometimes the hierarchical list are rendered ok like this one

- Bullet
	-  Bullet level 1
		-  Bullet level 2
			-  Bullet level 3


- Bullet level 0
	- Bullet level 1 
		- Bullet leve; 2
			- Bullet level 3 

Any updates on when this will be addressed?

I just wanted to add that this bug effectively breaks block referencing nested lists as well when the block reference is put on the next line. The nested list as well as the embedded nested list will both be displayed as flattened.

1 Like

No, it will get fixed when move to a new version of the renderer and thatā€™s gonna be a big jump.

I donā€™t quite agree here. We donā€™t support embedding nesting and itā€™s not just a matter of this bug.

1 Like

Sorry, you probably misunderstood me. What I meant was that the flattening of the nested list is not only caused by text or comments on the line after the nested list, but also by block references on the line after. An example would be:

- 1
  - 2
    - 3
^foo

will be displayed as

  • 1
    • 2
    • 3

in preview for the original list, as well as the embedded list ![[thispage#^foo]].

The title of this thread is ā€œNested list rendering broken if line after is not emptyā€

Isnā€™t this already coverded in the title?

The proper syntax for list referencing is to add a black line between the list and the id. This is the docs and itā€™s not just because of this bug in preview.

Iā€™m sorry I have to object (and I actually donā€™t want to draw this further OT), but in the version of obsidian I am using (0.12.4) there are two different behaviors for block references:

- 1
- 2
	- 2.1

^foo

gives

  • 1
  • 2
    • 2.1

while without a blank line between:

- 1
- 2
	- 2.1
^foo

gives (note the missing first bullet point)

  • 2
    • 2.1

The difference between both implementations seems to be intentional (and totally makes sense from a design point of view). If you can tell me that this is not intended behavior of obsidian, please let me know because in the moment I heavily rely on the second implementation, which is affected by the bug mentioned hereā€¦

Yes, youā€™re totally right. It simply wanted to highlight, that itā€™s not just a matter of ā€œnote to myself: donā€™t forget the blank linesā€, but it interferes with the way block references are implemented (as described above) and there is no workaround.

There is no second implementation.
To reference a list there must be a blank line between the list and the id.

https://help.obsidian.md/How+to/Link+to+blocks#Manual+block+IDs

Maybe you are confused and you asking for this: https://forum.obsidian.md/t/support-sub-list-block-id-linking/9151