deathau / cm-editor-syntax-highlight-obsidian

A plugin for [Obsidian](https://obsidian.md) which allows syntax highlighting for code blocks in the editor.
499 stars 37 forks source link

Strange behavior when code fence is beneath a multi-level list #14

Open captaincaed opened 3 years ago

captaincaed commented 3 years ago

When a code fence is under a multi-level list and the language is specified, I'm seeing behavior where the code fence extends to the end of the document. Any insights?

Also, LOVE this plugin, couldn't do without it.

Good Behavior image

Indented and language specified image

Indented, language not specified image

edentsai commented 3 years ago

Here is a similiar problem about using indented code block with the diff syntax highlighting in a list.

without indentation, the diff syntax highlighting works well:

image

strange behavior with indentation in a list (in edit mode):

image

but it can be render as expected in the preview mode.

image

the problem can be resolved without the diff syntax highlighting:

image

I also tried yaml and json syntax highlighting are works well:

image

image