Indenting tables after ol (ordered list)

Operating system

Linux

Joplin version

2.13.8

What issue do you have?

I noticed that I could not indent a table if the previous element is an ordered list (ol). It's strange, because with an unordered list (ul) it works just fine.

The following renders just fine :

- item1
- item2
  |AAA|BBB|
|---|---|
|ccc|ddd|
- item3

The table is indented and aligned with the previous bullet point.

But with an ordered list, it doesn't work :

1. Item1
1. Item2
  |AAA|BBB|
|---|---|
|ccc|ddd|
3. Item3

The table isn't indented (it displays a 3 columns tables instead of the 2 columns, see screenshot). Is this the intended behavior ?

Screenshots

issue_ordered-vs-unordered-list.png

For tab indented list items nested under an ordered list, all lines of nested items need to be aligned with each other.

The difference with space indented items is that all nested list item lines must be aligned with their parent ordered list item.

For example, the following space indented list items render just fine:

1. Item 1
   |AAA|BBB|
   |---|---|
   |ccc|ddd|
2. Item 2
   - List item

So do the following:

99. Item 99
    |AAA|BBB|
    |---|---|
    |ccc|ddd|
100. Item 100
     > Blockquote

You could try only using 1. or any other single digit(s) for ordered lists. If you use the Markdown viewer (or split view), it automatically updates ordered list numbers.

You could also try using the Space Indenter plugin to set tab or space indent width as desired:

  • Tabs let multi-line elements render properly at any tab indent width. This works for short indents like what you posted, but might not be preferred if syncing with mobile clients.
  • Space indent width can be set to 3+ spaces to avoid this issue. Single digit ordered lists can make this even more consistent.
2 Likes

Great, thanks !

That's the key, using the right number of spaces for indentation (three for single-digit ordered list items, and two for unordered list items. When I tried before I didn't use the right number of spaces, that's why it didn't render as expected.

Funny thing though : to indent a table after an unordered list item, only the first line of the table needs to be indented (of course it's cleaner to indent all lines). So the following codes both render the same :

- Item1
  |AAA|BBB|
|---|---|
|ccc|ddd|
- Item2
  |AAA|BBB|  
  |---|---|
  |ccc|ddd|

Within an ordered list, all table lines need to be indented.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.