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 11import { CodeFile } from "./editor-shift"
22import { IRawTheme } from "vscode-textmate"
3- import { ColorName , getColor } from "utils"
3+ import { ColorName , getColor , getColorScheme } from "utils"
44import React from "react"
55
66export function CodeBrowser ( {
@@ -189,15 +189,20 @@ function Content({
189189 theme ,
190190 ColorName . SelectionBackground
191191 ) ,
192+ colorScheme : getColorScheme ( theme ) ,
192193 } }
193194 >
194195 { file . code . lines . map ( ( line , i ) => (
195196 < 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+ ) }
201206 </ div >
202207 ) ) }
203208 </ div >
You can’t perform that action at this time.
0 commit comments