File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/mdx/src/mini-editor Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { CodeFile } from "./editor-shift"
2
2
import { IRawTheme } from "vscode-textmate"
3
- import { ColorName , getColor } from "utils"
3
+ import { ColorName , getColor , getColorScheme } from "utils"
4
4
import React from "react"
5
5
6
6
export function CodeBrowser ( {
@@ -189,15 +189,20 @@ function Content({
189
189
theme ,
190
190
ColorName . SelectionBackground
191
191
) ,
192
+ colorScheme : getColorScheme ( theme ) ,
192
193
} }
193
194
>
194
195
{ file . code . lines . map ( ( line , i ) => (
195
196
< div key = { i } >
196
- { line . tokens . map ( ( token , i ) => (
197
- < span key = { i } { ...token . props } >
198
- { token . content }
199
- </ span >
200
- ) ) }
197
+ { line . tokens . length === 0 ? (
198
+ < br />
199
+ ) : (
200
+ line . tokens . map ( ( token , i ) => (
201
+ < span key = { i } { ...token . props } >
202
+ { token . content }
203
+ </ span >
204
+ ) )
205
+ ) }
201
206
</ div >
202
207
) ) }
203
208
</ div >
You can’t perform that action at this time.
0 commit comments