workbench icon indicating copy to clipboard operation
workbench copied to clipboard

Nested lists render incorrectly inside of tab sets

Open jesse-ross opened this issue 8 months ago • 3 comments

Nested lists are not rendering correctly for me inside of tab sets.

For example, the following tab set (which only has one tab, but the problem also happens with multiple tabs)

Some introductory text

::: tab

### the name of a tab

1. A
    1. B
    1. C
1. D
    1. E
    1. F

:::

Some text which follows

renders as

Image

Note that the inner level items are printed above the full nested list in this output.

The same nested list renders correctly outside of tab sets.

I am running sandpaper 0.16.12 / pandoc 3.1.3.

jesse-ross avatar May 21 '25 21:05 jesse-ross

Thanks for submitting this issue @jesse-ross ! I can reproduce this here so we can try to dig into it.

Hey @astroDimitrios - would this be down to the following line and how pandoc processes the list within the tab block content?

https://github.com/carpentries/sandpaper/pull/571/files#diff-b47ff2f319476ff47f4c25b923f495fc8b396769fea319a0c822466646eff330R444

froggleston avatar May 22 '25 14:05 froggleston

@froggleston Sorry for the late reply, I was on AL. Yes that's the right bit of the lua. This behaviour is seen because when pandoc walks the block it does so from the lowest point upwards (so in the case above it sees the lists B C and then EF before the list A D that they are nested in). I can have another go at seeing if it's possible to add whole blocks below the tab without walking them - when I added in the feature initially I couldn't find a way to deal with nesting through lua.

In the meantime @jesse-ross is there a way you can re-write the material to avoid nesting?

astroDimitrios avatar May 27 '25 10:05 astroDimitrios

@astroDimitrios Yes, I have rewritten the material, so there is no urgency for a fix on my side. Thanks very much for your response and for your attention to the bug!

jesse-ross avatar May 27 '25 17:05 jesse-ross