-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
💊 bugSomething isn't workingSomething isn't working
Description
Gogs version
0.13.3
Git version
git version 2.39.5
Operating system
Debian 12
Database
SQLite 3
Describe the bug
When a Markdown fenced code block follows a list (bulleted or numbered), Gogs renders the code block inside the last list item (<li>), instead of closing the list and rendering the code block as a separate element.
This results the last item gets wrapped in <p> tags and includes the <pre> block, which differs from standard GitHub-flavored Markdown rendering.
To reproduce
Create a markdown file or comment with the following content:
- foo
- bar
- baz
```
some code
```
Current rendering in Gogs (HTML):
<ul>
<li>foo</li>
<li>bar</li>
<li>
<p>baz</p>
<pre><code class="hljs armasm"><span class="hljs-symbol">some</span> <span class="hljs-meta">code</span></code></pre>
</li>
</ul>(The code block is nested inside the last <li>)
Expected behavior
The list should be closed, and the code block should follow it.
Additional context
I'm not sure, but this may be the reason:
In internal/markup/markdown.go:
extensions |= blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCKCode of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
💊 bugSomething isn't workingSomething isn't working