Lists (ul and ol) inside code block are broken

Steps to reproduce

  • Create code block
  • Start a new ul with "- " or ol with "1. " inside the code block
  • Press enter/return to start a new line

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

Yes.

Expected result

I would expect either the ul/ol to behave as they do outside of the code block, and continue the ul/ol with a "- " or "2. " on the new line OR for the new line to start without anything in it

Actual result

The new line starts with a blank indent the length of the ul/ol syntax (two-space length and three-space length respectively)

Environment

SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.4
Operating system: Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:33 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8140 25.4.0
Login status: logged in
Language: en
Catalyst license: supporter
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 1
Plugins enabled: 1
1: Maps v0.1.6
RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

I’m pretty sure this was broken less than a year and a half ago, and I’ve just taken a long time to get around to making a bug report for it, since it’s a relatively easy-to-fix-and-forget-about annoyance in my daily work routine. I know that the behavior prior to breaking was that the ul/ol would continue inside the code block like it did outside of it, but I also understand if it makes more logical sense to not do that inside a code block.
I have reproduced this bug on various devices (Mac, PC, iOS), including in vaults without any community plugins - the device I’m writing this bug report on just happens to have one single plugin on it right now.

I don’t consider this a bug.

If are writing anything except MARKDOWN, doing what you suggest is gonna be pretty annoying to the users.

We should not even add the spaces.

Yep, that’s what I mention in the second part of the ‘Expected Result’ part of my post—I understand that since it’s a code block it might not need to format as a list, even though it did in the past. Either way, though, I think adding the spaces is still a bug?

thanks, I will write the BR for that.

1 Like