canonical / canonicalwebteam.discourse

GNU Lesser General Public License v3.0
11 stars 16 forks source link

500 error when navigation table has rows without level #134

Open bartaz opened 2 years ago

bartaz commented 2 years ago

Not sure if it's a bug or "feature", but seems that having navigation table items without level between items that have level breaks the nav parsing.

[details=Navigation]
| Level | Path | Navlink |
| -- | -- | -- |
| 1 | test1 | [Heading1](https://discourse.ubuntu.com/t/how-to-write-and-format-discourse-specs/27036) |
| 1 | test2 | [Heading2](https://discourse.ubuntu.com/t/segmented-control-component/26835) |
| | test-hidden | Test |
| 2 | test3 | [Heading2](https://discourse.ubuntu.com/t/segmented-control-component/26835) |
| 3 | test4 | [Heading2](https://discourse.ubuntu.com/t/segmented-control-component/26835) |
| 3 | test5 | [Heading2](https://discourse.ubuntu.com/t/segmented-control-component/26835) |
[/details]

Having something like this (having items with level above 1 after empty level) breaks navigation parsing with 500 error.

Screenshot 2022-06-21 at 15 00 07

I don't know if rows without level have any special meaning, but maybe they should just be ignored, and not make the navigation parsing break? Or is this expected to have level 0 or 1 after empty level for some reason?

tmihoc commented 2 years ago

Hi. It would really help to have either support for level 4 or for level null (leaving the level empty). I have a lot of level 4 or even 5 entries in my docs, and I understand if we cannot display them in the Navigation bar for space reason, but it would help me to see them there in the Navigation table so I know to reference them from the parent level doc. (Available for a call if that helps.)