Use of indent in diff code block causes appearance problems

Steps to reproduce

  1. Start the sandbox vault and enter this content into the editor
# H1

## H2

```diff
- const date = new Date();
+ const date = Date.now();
  1. foo

    - const date = new Date();
    + const date = Date.now();
    
  2. bar

  3. baz


### Expected result

diff Code blocks are displayed indented.

### Actual result

Cord block does not close and appearance collapses.

### Environment

SYSTEM INFO:
 Obsidian version: v1.1.16
 Installer version: v1.1.16
 Operating system: Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 21.6.0
 Login status: not logged in
 Insider build toggle: off
 Live preview: on
 Legacy editor: off
 Base theme: dark
 Community theme: none
 Snippets enabled: 0
 Restricted mode: on

RECOMMENDATIONS:
 none



----------

### Additional information

Attached is a screenshot.

![diff-code-block|503x500](upload://yWmexo3vXn1X3WCv1YpITJiar1O.png)
1 Like

The post is broken and will be corrected.

Steps to reproduce

  1. Start the sandbox vault and enter this content into the editor (Please remove the backslash.)
# H1

## H2

\```diff
- const date = new Date();
+ const date = Date.now();
\```

1. foo

    \```diff
    - const date = new Date();
    + const date = Date.now();
    \```

2. bar
3. baz

Expected result

diff Code blocks are displayed indented.

Actual result

Cord block does not close and appearance collapses.

Environment

SYSTEM INFO:
Obsidian version: v1.1.16
Installer version: v1.1.16
Operating system: Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 21.6.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

Attached is a screenshot.

As far as I’m aware, codeblocks cannot be indented like that. They have to be all the way on the left. The code inside them can be but the codeblock themselves cannot.
If I am wrong, feel free to let me know (someone) but I’m about 80% sure.

Thanks for the reply.

Yes, I am. There is no problem with the code block being on the left side.
What I consider the problem this time is that the code block cannot be closed.

As an example, I attach an image comparing python code block and diff code block.

Weird indeed. Video of the behaviour:

I’m not sure it’s something we need to fix because of the aforementioned indenting-code-blocks issue, though.

this is a problem of the parser of codeblocks in editor, specific to diffs