# Code blocks in task lists look broken

**URL:** <https://forum.obsidian.md/t/code-blocks-in-task-lists-look-broken/110708>\
**Category:** Bug graveyard\
**Created:** [February 1, 2026, 9:49pm UTC](https://forum.obsidian.md/t/code-blocks-in-task-lists-look-broken/110708 "2026-02-01T21:49:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KikuGie](https://forum.obsidian.md/user_avatar/forum.obsidian.md/kikugie/32/89446_2.png) [@KikuGie](https://forum.obsidian.md/u/KikuGie)\
**Post date:** [February 1, 2026, 9:49pm UTC](https://forum.obsidian.md/t/code-blocks-in-task-lists-look-broken/110708/1 "2026-02-01T21:49:39Z")

</div>

### Steps to reproduce

- Create a new file in Obsidian.
- Paste in the following text as the content:

````auto
- [] 1
      This code block is not rendered at all in source mode, and renders as a single line in the reader mode:
      ```rust
      fn main() {
	      println!("Hello World!");
      }
      ```
- [] 2
Avoiding indentation works for text, but not code blocks:
```rust
fn main() {
	println!("Hello World!");
}
```
- 3
	Regular lists work though?
	```rust
	fn main() {
		println!("Hello World!");
	}
	```

````

### Did you follow the troubleshooting guide? [Y/N]

Yes, it was tested without any plugins or themes in sandbox on version 1.11.5.

### Expected result

See screenshots below.  
The code block in the first element of the list should look like in the third.

### Actual result

See screenshots below.  
When indented after a `- []` list element, the code block rendering is broken in source and reader modes.

### Environment

SYSTEM INFO:  
Obsidian version: v1.11.5  
Installer version: v1.11.5  
Operating system: #1 SMP PREEMPT\_DYNAMIC Sat, 31 Jan 2026 04:46:44 +0000 6.18.8-2-cachyos  
Login status: not logged in  
Language: en  
Insider build toggle: off  
Live preview: on  
Base theme: adapt to system  
Community theme: none  
Snippets enabled: 0  
Restricted mode: on  
RECOMMENDATIONS:  
none

* * *

### Additional information

 ![Screenshot From 2026-02-01 22-44-53](https://forum.obsidian.md/uploads/default/original/3X/7/f/7febe984270fab28205c5077f5042314e8eb2270.png)

 ![Screenshot From 2026-02-01 22-45-06](https://forum.obsidian.md/uploads/default/original/3X/7/c/7cbf75f825a86cc49b88aa787a16d485ad6871cd.png)

---

<div class="post-metadata">

**Author:** ![KikuGie](https://forum.obsidian.md/user_avatar/forum.obsidian.md/kikugie/32/89446_2.png) [@KikuGie](https://forum.obsidian.md/u/KikuGie)\
**Post date:** [February 1, 2026, 9:51pm UTC](https://forum.obsidian.md/t/code-blocks-in-task-lists-look-broken/110708/2 "2026-02-01T21:51:02Z")

</div>

This issue is even present on the web view…

 ![image](https://forum.obsidian.md/uploads/default/original/3X/5/0/504d2958f1494ebdfbb7cece5e94c15cce9a71c9.png)

---

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [February 2, 2026, 5:58am UTC](https://forum.obsidian.md/t/code-blocks-in-task-lists-look-broken/110708/3 "2026-02-02T05:58:41Z")

</div>

I put your entire example between **four** backticks so all of it was shown properly in the fourm:

 ![Screenshot 2026-02-02 145336](https://forum.obsidian.md/uploads/default/original/3X/f/6/f6b4839d3487d4a2fc55a2d6a806ab32fd790abd.png)

* * *

I was able to get it looking alright in Reading view with this spacing:

````auto
- [] 1 
This code block is not rendered at all in source mode, and renders as a single line in the reader mode:
     ```rust
      fn main() {
	      println!("Hello World!");
       }
     ```
      
- [] 2 
Avoiding indentation works for text, but not code blocks:
   ```rust
   fn main() {
	println!("Hello World!");
   }
   ```
- 3
	Regular lists work though?
	 ```rust
	 fn main() {
		println!("Hello World!");
	 }
	 ```

````

source mode | live preview | reading view

 ![image](https://forum.obsidian.md/uploads/default/original/3X/a/9/a93adee4e84536d3ee5240742c243d9b6610cd2b.png)

* * *

related:

> [@Live Preview: Better support of code blocks in lists](https://forum.obsidian.md/t/live-preview-better-support-of-code-blocks-in-lists/31352):
>
> Current Live Preview Reader

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [March 2, 2026, 5:59am UTC](https://forum.obsidian.md/t/code-blocks-in-task-lists-look-broken/110708/4 "2026-03-02T05:59:31Z")

</div>

Closed on March 2, 2026, 5:59am UTC

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