uiwjs / react-textarea-code-editor

A simple code editor with syntax highlighting.

Home Page:https://uiwjs.github.io/react-textarea-code-editor/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON Highlighting of Value the same as the Name when a string

jkoufalas opened this issue · comments

Hi

When highlighting JSON the name value pair is highlighting the same colour when the value is a string.
Is it possible to define the value if it a string so that it can be given another colour.

{
"state": "initial"
}

in this case both "state" and "initial" are the same colour. And for larger JSON objects it makes most of the object the same colour.

This way the colour scheme is more customisable through .w-tc-editor-var and I can match it to other outputs such as JSONPretty

You need to know how to use rehype-prism-plus.

@jkoufalas

import CodeEditor from '@uiw/react-textarea-code-editor';
import rehypePrism from 'rehype-prism-plus';

function App() {
  return (
    <CodeEditor
      plugins={[[rehypePrism, { ignoreMissing: true }]]}
    />
  );
}

thanks, it opened up some more classes i could use for css.
It also opened up the ability to use line numbers which is handy.

Thankyou