Incorrect Indentation of Nested Code Blocks in Exported Markdown Files

What’s The Bug?

When exporting a document in Markdown format, the nested unordered list items with code blocks are not handled correctly. Specifically, when using a code block (```) inside a nested unordered list item, the closing backticks of the code block are not indented properly. This causes the Markdown parser to treat a large portion of the subsequent text as part of the code block.

How To Reproduce It

  1. Create a new document in Anytype.
  2. Add an unordered list item (-).
  3. Nest another unordered list item under the first one.
  4. Within the nested list item, insert a code block using triple backticks (```) to enclose the code snippet.
  5. Export the document in Markdown format.
  6. Open the exported Markdown file in a Markdown editor or viewer.

The Expected Behavior

The closing backticks of the code block should be properly indented to align with the nested list structure, ensuring that only the intended code snippet is treated as part of the code block.

Actual Behavior

The closing backticks are not indented, causing the Markdown parser to interpret a large portion of the subsequent text as part of the code block.

  • Item 1
    • Sub-item 1
      Code block
      

Additional Context

This issue disrupts the readability and structure of the exported Markdown document, as it incorrectly formats large sections of text as code blocks. Proper indentation is crucial for maintaining the intended hierarchy and formatting of the document.

Thank you for your attention to this matter. I look forward to a resolution that ensures proper handling of nested list items with code blocks in Markdown exports.

Device

thinkpad

OS

windows11

Anytype Version

0.41.1

Network Mode

AntSync

Technical Information

Operating system version: win32 x64 10.0.22631
App version: 0.41.1
Build version: build on 2024-06-13 12:23:20 +0000 UTC at #48d85bd5470c4a6aaa6f38c2f37b04e7ce2fb637 (dirty)
Library version: v0.34.3
Anytype Identity: A9HqKQqJSYzbTFVWeaDPPjm9AksvHD5ukBYUPgkkHUVMMMWm
Analysis ID: 3465f454-5fc5-49f5-83a9-a90a527f07f8
Device ID: 12D3KooWSTseuymkFJERK9XzZ2AbZewpaHV6i6ef34X9G53mHGPF

This report has been added to our issue tracker and received by the Development Team.

This issue has been fixed by the Development Team and will be implemented in an upcoming release.