uiwjs / react-codemirror

CodeMirror 6 component for React. @codemirror https://uiwjs.github.io/react-codemirror/
https://uiwjs.github.io/react-codemirror/
MIT License
1.5k stars 125 forks source link

code highlighting #652

Closed pxsty0 closed 1 month ago

pxsty0 commented 2 months ago

Hi, how can I highlighting error lines of code in uiw codemirror? I couldn't find anything detailed about this in your documentation.

DErekXx commented 2 months ago

Hi. I faced a similar issue I guess. It's not possible to override the error className cm-lintRange-error, because it overrides any CSS rules, even if I use the special attribute markClass to apply my own styles.

The huge problem the CSS className cm-lintRange-error has a wrong background value that does not appear on the error state url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAw....") That is really confusing to me.

pxsty0 commented 1 month ago

Can managers look now?

pxsty0 commented 1 month ago

Can managers look now?

DErekXx commented 1 month ago

I guess something related switching of the light and dark theme. Because on the light theme, everything is fine. I do not know where exactly the problem is from the codemirror lib or react-codemirror. I just override this className from the diagnostic markClass, this fix works for me.

pxsty0 commented 1 month ago

@jaywcjlove

jaywcjlove commented 1 month ago

@pxsty0 https://codemirror.net/examples/lint/