Python FencedCode indentation inconsistent

Hi!

I’m playing around with markdown and embedded code, and I noticed that the python indentation is inconsistent when there’s no space after the current line. The example below is from the codemirror MD example I think what’s happening is that the insertNewlineContinueMarkup is being called but once there’s space below the cursor, insertNewlineAndIndent is called, though I’m not entirely sure.

I know there’s some places where markdown needs extra support for embedded code like in completions, and I was wondering if that’s the same case here where I need to add or do something to get the correct behavior, or could this be a bug or just a limitation of embedding code in markdown and just handle it with an Enter keymap?

Thanks!

indent

Might it be related to the parsing? Commenting on the first line of the fenced code also applied markdown comment, also happens with JS codeblocks.

comment

This was two separate issues, both caused by confusion around language boundaries. See these patches.

1 Like

Thank you very much for your work!