Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jkoufalas opened this issue May 11, 2023 · 2 comments
Closed

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

jkoufalas opened this issue May 11, 2023 · 2 comments

Comments

@jkoufalas
Copy link

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

@jaywcjlove
Copy link
Member

jaywcjlove commented May 11, 2023

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 }]]}
    />
  );
}

@jkoufalas
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants