@@ -176,7 +176,7 @@ function createPlugin() {
176176 replaceColor,
177177 extensionDataDirectory,
178178 logLevel,
179- ...rest ,
179+ ...rest
180180 } ) ;
181181
182182 /** @type {Record<string, string> } */
@@ -227,7 +227,11 @@ function createPlugin() {
227227
228228 const themeClassName = themeClassNames [ setting ] ;
229229 const themeCache = await cache . get ( 'themes' ) ;
230- const colorThemePath = ensureThemeLocation ( colorThemeIdentifier , themeCache , markdownNode . fileAbsolutePath ) ;
230+ const colorThemePath = await ensureThemeLocation (
231+ colorThemeIdentifier ,
232+ themeCache ,
233+ markdownNode . fileAbsolutePath
234+ ) ;
231235
232236 const { resultRules : tokenColors , resultColors : settings } = loadColorTheme ( colorThemePath ) ;
233237 const defaultTokenColors = {
@@ -310,9 +314,9 @@ function createPlugin() {
310314 const endIndex = result . tokens [ i + 2 ] || line . length ;
311315 /** @type {LineData } */
312316 htmlLine . push (
313- span ( { class : getClassNameFromMetadata ( metadata ) } , [
314- escapeHTML ( line . slice ( startIndex , endIndex ) )
315- ] , { whitespace : TriviaRenderFlags . NoWhitespace } ) ,
317+ span ( { class : getClassNameFromMetadata ( metadata ) } , [ escapeHTML ( line . slice ( startIndex , endIndex ) ) ] , {
318+ whitespace : TriviaRenderFlags . NoWhitespace
319+ } )
316320 ) ;
317321 }
318322 } else {
@@ -321,24 +325,25 @@ function createPlugin() {
321325
322326 /** @type {LineData } */
323327 const lineData = { codeFenceOptions : options , index : lineIndex , content : line , language : languageName } ;
324- const className = joinClassNames (
325- getLineClassName ( lineData ) ,
326- 'vscode-highlight-line'
327- ) ;
328+ const className = joinClassNames ( getLineClassName ( lineData ) , 'vscode-highlight-line' ) ;
328329
329- htmlLines . push ( span (
330- mergeAttributes ( { class : className } , attrs ) ,
331- htmlLine ,
332- { whitespace : TriviaRenderFlags . NoWhitespace }
333- ) ) ;
330+ htmlLines . push (
331+ span ( mergeAttributes ( { class : className } , attrs ) , htmlLine , { whitespace : TriviaRenderFlags . NoWhitespace } )
332+ ) ;
334333 }
335334
336335 const className = joinClassNames ( wrapperClassName , joinThemeClassNames ( themeClassNames ) , 'vscode-highlight' ) ;
337336 node . type = 'html' ;
338337 node . value = renderHTML (
339- pre ( { class : className , 'data-language' : languageName } , [
340- code ( { class : 'vscode-highlight-code' } , htmlLines , { whitespace : TriviaRenderFlags . NewlineBetweenChildren } )
341- ] , { whitespace : TriviaRenderFlags . NoWhitespace } )
338+ pre (
339+ { class : className , 'data-language' : languageName } ,
340+ [
341+ code ( { class : 'vscode-highlight-code' } , htmlLines , {
342+ whitespace : TriviaRenderFlags . NewlineBetweenChildren
343+ } )
344+ ] ,
345+ { whitespace : TriviaRenderFlags . NoWhitespace }
346+ )
342347 ) ;
343348 } finally {
344349 unlockRegistry ( ) ;
@@ -352,9 +357,9 @@ function createPlugin() {
352357 value : renderHTML (
353358 style ( { class : 'vscode-highlight-styles' } , [
354359 injectStyles ? styles : '' ,
355- ...themeNames . map ( theme => stylesheets [ theme ] ) ,
360+ ...themeNames . map ( theme => stylesheets [ theme ] )
356361 ] )
357- ) ,
362+ )
358363 } ) ;
359364 }
360365 }
0 commit comments