# Markdown Code Block Formatting Issue

**URL:** <https://forum.cursor.com/t/markdown-code-block-formatting-issue/48787>\
**Category:** Bug Reports\
**Created:** [February 7, 2025, 11:59am UTC](https://forum.cursor.com/t/markdown-code-block-formatting-issue/48787 "2025-02-07T11:59:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moersoy](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/moersoy/32/25022_2.png) [@moersoy](https://forum.cursor.com/u/moersoy)\
**Post date:** [February 7, 2025, 11:59am UTC](https://forum.cursor.com/t/markdown-code-block-formatting-issue/48787/1 "2025-02-07T11:59:47Z")

</div>

Description:

- When trying to create nested code blocks in markdown
- The formatting breaks and becomes inconsistent
- Code blocks are not properly closed/nested

Steps to Reproduce:

1. Create a markdown file
2. Add nested code blocks
3. See formatting issues

Expected Behavior:

- Nested code blocks should maintain proper formatting
- Markdown syntax highlighting should work correctly

Actual Behavior:

- Code blocks break
- Formatting becomes inconsistent
- Syntax highlighting fails

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/8/7/879fe869ec48ef1c5ab8b097db6d558b7e94e1f2.png)

---

<div class="post-metadata">

**Author:** ![hercules](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/hercules/32/24294_2.png) [@hercules](https://forum.cursor.com/u/hercules)\
**Post date:** [February 7, 2025, 3:28pm UTC](https://forum.cursor.com/t/markdown-code-block-formatting-issue/48787/2 "2025-02-07T15:28:38Z")

</div>

This also happens quite frequently. I have to copy and paste each segment separately.

---

<div class="post-metadata">

**Author:** ![zukoff](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/zukoff/32/26974_2.png) [@zukoff](https://forum.cursor.com/u/zukoff)\
**Post date:** [February 16, 2025, 3:10am UTC](https://forum.cursor.com/t/markdown-code-block-formatting-issue/48787/3 "2025-02-16T03:10:25Z")

</div>

Have the same issue, extremely disappointing one,

---

<div class="post-metadata">

**Author:** ![danperks](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/danperks/32/19087_2.png) [@danperks](https://forum.cursor.com/u/danperks)\
**Post date:** [February 16, 2025, 12:11pm UTC](https://forum.cursor.com/t/markdown-code-block-formatting-issue/48787/4 "2025-02-16T12:11:04Z")

</div>

Yeah the markdown formatting can be a bit tricky right now, especially with nested code blocks. We’re working on improving this in an upcoming update that should make it much smoother. For now you might want to break up complex nested blocks into separate snippets
