File tree 4 files changed +28
-1
lines changed
4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export interface ReactCodeMirrorProps
28
28
* `light` / `dark` / `Extension` Defaults to `light`.
29
29
* @default light
30
30
*/
31
- theme ?: 'light' | 'dark' | Extension ;
31
+ theme ?: 'light' | 'dark' | 'none' | Extension ;
32
32
/**
33
33
* Whether to optional basicSetup by default
34
34
* @default true
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ export function useCodeMirror(props: UseCodeMirror) {
91
91
case 'dark' :
92
92
getExtensions . push ( oneDark ) ;
93
93
break ;
94
+ case 'none' :
95
+ break ;
94
96
default :
95
97
getExtensions . push ( theme ) ;
96
98
break ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { ColorDoc } from './pages/extensions/color';
18
18
import { MentionsDoc } from './pages/extensions/mentions' ;
19
19
import { ThemesAllDoc } from './pages/extensions/themes' ;
20
20
import { ZebraStripesDoc } from './pages/extensions/zebra-stripes' ;
21
+ import { PageExample431 } from './pages/examples/Example431' ;
21
22
22
23
export const GlobalStyle = createGlobalStyle `
23
24
[data-color-mode*='dark'], [data-color-mode*='dark'] body {
@@ -93,6 +94,9 @@ root.render(
93
94
< Route path = "mentions" element = { < MentionsDoc /> } />
94
95
< Route path = "zebra-stripes" element = { < ZebraStripesDoc /> } />
95
96
</ Route >
97
+ < Route path = "/examples/" element = { < ExtensionsLayout /> } >
98
+ < Route path = "431" element = { < PageExample431 /> } />
99
+ </ Route >
96
100
</ Routes >
97
101
</ HashRouter > ,
98
102
) ;
Original file line number Diff line number Diff line change
1
+ import CodeMirror from '@uiw/react-codemirror' ;
2
+ import { langs } from '@uiw/codemirror-extensions-langs' ;
3
+ import { Fragment } from 'react' ;
4
+
5
+ /**
6
+ * https://github.com/uiwjs/react-codemirror/issues/431
7
+ */
8
+ export const PageExample431 = ( ) => {
9
+ return (
10
+ < Fragment >
11
+ < h1 > How to remove all syntax highlighting?</ h1 >
12
+ < CodeMirror
13
+ value = { `console.log('hello')` }
14
+ theme = "none"
15
+ height = "400px"
16
+ style = { { margin : '0 0 23px 0' } }
17
+ extensions = { [ langs . markdown ( ) ] }
18
+ />
19
+ </ Fragment >
20
+ ) ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments