Wrong rendering of Code Blocks in markdown inside unordered list #2210

Open
opened 2026-02-05 03:19:39 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @sirrrich on GitHub (Apr 21, 2021).

If I create Code Blocks inside a unordered list entry the final rendering is shifted while in the preview everything is ok.

Steps To Reproduce

Create new site with content:

  • test

    test
    

Screenshots
MarkdownEditor

BookstackRendering

Your Configuration (please complete the following information):

  • Exact BookStack Version (0.31.6):
  • PHP Version: ?
  • Hosting Method (nginx):
Originally created by @sirrrich on GitHub (Apr 21, 2021). If I create Code Blocks inside a unordered list entry the final rendering is shifted while in the preview everything is ok. **Steps To Reproduce** Create new site with content: - test ``` test ``` **Screenshots** ![MarkdownEditor](https://user-images.githubusercontent.com/25660656/115570677-9c9db800-a2be-11eb-8c61-e0ecb2009cc4.PNG) ![BookstackRendering](https://user-images.githubusercontent.com/25660656/115570972-d79feb80-a2be-11eb-9b9b-358d542d6d09.PNG) **Your Configuration (please complete the following information):** - Exact BookStack Version (0.31.6): - PHP Version: ? - Hosting Method (nginx):
OVERLORD added the 🐛 Bug> Markdown Editor🏭 Back-End labels 2026-02-05 03:19:39 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Apr 27, 2021):

Thanks for reporting @sirrrich.

Can confirm this. Seems to be when the proceeding code block whitespace is done with tabs. Using spaces results in a working output.

Tabs produces a different, yet non-malformed as desired, output on the commonmark playground: https://spec.commonmark.org//dingus/?text=-%20test%0A%0A%09%60%60%60%0A%09test%0A%09%60%60%60

Ideally will need to find some time to confirm this and look to fix upstream within https://github.com/thephpleague/commonmark.

@ssddanbrown commented on GitHub (Apr 27, 2021): Thanks for reporting @sirrrich. Can confirm this. Seems to be when the proceeding code block whitespace is done with tabs. Using spaces results in a working output. Tabs produces a different, yet non-malformed as desired, output on the commonmark playground: https://spec.commonmark.org//dingus/?text=-%20test%0A%0A%09%60%60%60%0A%09test%0A%09%60%60%60 Ideally will need to find some time to confirm this and look to fix upstream within https://github.com/thephpleague/commonmark.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2210