Wiki: second level list not rendered correctly if followed by a code block #9243

Closed
opened 2025-11-02 08:33:06 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @OhSoGood on GitHub (Jul 20, 2022).

Description

In the wiki, a 2nd-level list item (i.e. a list item with space/tab before) is not rendered in as a code block if it is located after a code block (i.e surrounded with ```` ).

Example:

This is a text

This is code 1 and renders ok
  • This is a level-1 list item
This is code 2 and renders ok
  • This is another level-1 list item
This is code 3 and renders ok
  • This is a third level-1 list item
    • This is a level-2 list item and renders ok
This is code 4 and rendering is ok
- This is a another level-2 list item and rendering is broken. It is in code block but shouldn't.
This is code 5 and renders ok
- This is a third level-2 list item and rendering is broken. It is in code block but shouldn't.
- This is a fourth level-2 list item and rendering is broken. It is in code block but shouldn't.

Gitea Version

1.16.9

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

broken rendering

Git Version

No response

Operating System

No response

How are you running Gitea?

package downloaded from Gitea's official repo

Database

No response

Originally created by @OhSoGood on GitHub (Jul 20, 2022). ### Description In the wiki, a 2nd-level list item (i.e. a list item with space/tab before) is not rendered in as a code block if it is located after a code block (i.e surrounded with ```` ). Example: This is a text ``` This is code 1 and renders ok ``` - This is a level-1 list item ``` This is code 2 and renders ok ``` - This is another level-1 list item ``` This is code 3 and renders ok ``` - This is a third level-1 list item - This is a level-2 list item and renders ok ``` This is code 4 and rendering is ok ``` - This is a another level-2 list item and rendering is broken. It is in code block but shouldn't. ``` This is code 5 and renders ok ``` - This is a third level-2 list item and rendering is broken. It is in code block but shouldn't. - This is a fourth level-2 list item and rendering is broken. It is in code block but shouldn't. ### Gitea Version 1.16.9 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots ![broken rendering](https://user-images.githubusercontent.com/1809098/179991582-e6220ab2-75aa-4f9d-a22e-a12b0139515d.jpg) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? package downloaded from Gitea's official repo ### Database _No response_
GiteaMirror added the type/bug label 2025-11-02 08:33:06 -06:00
Author
Owner

@Gusted commented on GitHub (Jul 21, 2022):

Could you upload the message in a file? I'm not able to get your original formatting from the issue comment.

@Gusted commented on GitHub (Jul 21, 2022): Could you upload the message in a file? I'm not able to get your original formatting from the issue comment.
Author
Owner

@OhSoGood commented on GitHub (Jul 23, 2022):

Hi @Gusted ,
I've attached the sample message which shows the issue: sample.txt

@OhSoGood commented on GitHub (Jul 23, 2022): Hi @Gusted , I've attached the sample message which shows the issue: [sample.txt](https://github.com/go-gitea/gitea/files/9173795/sample.txt)
Author
Owner

@Gusted commented on GitHub (Jul 26, 2022):

I'm not so sure if I understand the issue correctly. Because the rendered markdown is correct(Github & Official spec renders the same HTML) according to your input.
If I read your issue correctly, the last two list items are incorrectly rendered according to you. However Anything that has four spaces before it's text will be rendered as a codeblock, there doesn't exist anything like second-level item list without a one-level item list as it's parent.

@Gusted commented on GitHub (Jul 26, 2022): I'm not so sure if I understand the issue correctly. Because the rendered markdown is correct(Github & [Official spec](https://spec.commonmark.org/dingus/) renders the same HTML) according to your input. If I read your issue correctly, the last two list items are incorrectly rendered according to you. However Anything that has four spaces before it's text will be rendered as a codeblock, there doesn't exist anything like second-level item list without a one-level item list as it's parent.
Author
Owner

@facorazza commented on GitHub (Jul 26, 2022):

Hi @Gusted , I've attached the sample message which shows the issue: sample.txt

Perhaps you're trying to do this:

This is a text

This is code 1 and renders ok
  • This is a level-1 list item
This is code 2 and renders ok
  • This is another level-1 list item
This is code 3 and renders ok
  • This is a third level-1 list item
    • This is a level-2 list item and renders ok
    This is code 4 and rendering is ok
    
    • This is a another level-2 list item and rendering is broken. It is in code block but shouldn't.
    This is code 5 and renders ok
    
    • This is a third level-2 list item and rendering is broken. It is in code block but shouldn't.
    • This is a fourth level-2 list item and rendering is broken. It is in code block but shouldn't.

sample.txt

@facorazza commented on GitHub (Jul 26, 2022): > Hi @Gusted , I've attached the sample message which shows the issue: [sample.txt](https://github.com/go-gitea/gitea/files/9173795/sample.txt) Perhaps you're trying to do this: This is a text ``` This is code 1 and renders ok ``` - This is a level-1 list item ``` This is code 2 and renders ok ``` - This is another level-1 list item ``` This is code 3 and renders ok ``` - This is a third level-1 list item - This is a level-2 list item and renders ok ``` This is code 4 and rendering is ok ``` - This is a another level-2 list item and rendering is broken. It is in code block but shouldn't. ``` This is code 5 and renders ok ``` - This is a third level-2 list item and rendering is broken. It is in code block but shouldn't. - This is a fourth level-2 list item and rendering is broken. It is in code block but shouldn't. [sample.txt](https://github.com/go-gitea/gitea/files/9193349/sample.txt)
Author
Owner

@OhSoGood commented on GitHub (Jul 27, 2022):

That was it. Thank you very much both of you!
Despite some searchs, I hadn't found any examples on how to do it.

@OhSoGood commented on GitHub (Jul 27, 2022): That was it. Thank you very much both of you! Despite some searchs, I hadn't found any examples on how to do it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9243