obsidian-codemirror-options icon indicating copy to clipboard operation
obsidian-codemirror-options copied to clipboard

code will not show highlighting in preview mode

Open mylovesaber opened this issue 3 years ago • 4 comments

version:0.9.0 If I enable "Use CodeMirror for syntax highlighting in preview mode", all the code highlighting will have no effect for java/JAVA/Java/bash(only shell is ok). I just want to show the line number. Is it a bug?

image image

mylovesaber avatar Nov 19 '21 13:11 mylovesaber

I believe this should be fixed in the new 0.9.1 release

nothingislost avatar Nov 19 '21 16:11 nothingislost

I believe this should be fixed in the new 0.9.1 release

One more bug and a not fixed bug.

  1. If I don't specify the language name, the preview code is too hard to watch(This happened in the previous and the latest version) image

  2. The bug is still be there. image

(Switch theme function in the Style Settings won't work until the option is enabled,)

mylovesaber avatar Nov 19 '21 16:11 mylovesaber

I believe this should be fixed in the new 0.9.1 release Maybe another bug? If I combine codemirror with admonition, the symbols are hard to see clearly in preview mode. And theme in preview mode is different from edit mode. No matter how I switch code theme, the color won't change in the preview mode when combine with admonition. Line number also disappeared! image

mylovesaber avatar Nov 20 '21 16:11 mylovesaber

I'll look into these but the nested code blocks inside of admonitions is going to be a bit tricky to sort out. You're seeing different highlighting because that's Prism.JS highlighting the code on the right side vs. CodeMirror. I'll see what I can do.

nothingislost avatar Nov 24 '21 22:11 nothingislost