@@ -40,7 +40,7 @@ export class MarkdownContentProvider {
4040 private readonly engine : MarkdownEngine ,
4141 private readonly context : vscode . ExtensionContext ,
4242 private readonly cspArbiter : ContentSecurityPolicyArbiter ,
43- private readonly extensionPreviewResourceProvider : MarkdownContributions ,
43+ private readonly contributions : MarkdownContributions ,
4444 private readonly logger : Logger
4545 ) { }
4646
@@ -125,7 +125,7 @@ export class MarkdownContentProvider {
125125 }
126126
127127 private computeCustomStyleSheetIncludes ( resource : vscode . Uri , config : MarkdownPreviewConfiguration ) : string {
128- if ( config . styles && Array . isArray ( config . styles ) ) {
128+ if ( Array . isArray ( config . styles ) ) {
129129 return config . styles . map ( style => {
130130 return `<link rel="stylesheet" class="code-user-style" data-source="${ style . replace ( / " / g, '"' ) } " href="${ this . fixHref ( resource , style ) } " type="text/css" media="screen">` ;
131131 } ) . join ( '\n' ) ;
@@ -144,17 +144,18 @@ export class MarkdownContentProvider {
144144 }
145145
146146 private getStyles ( resource : vscode . Uri , nonce : string , config : MarkdownPreviewConfiguration ) : string {
147- const baseStyles = this . extensionPreviewResourceProvider . previewStyles . map ( resource => resource . toString ( ) ) ;
147+ const baseStyles = this . contributions . previewStyles
148+ . map ( resource => `<link rel="stylesheet" type="text/css" href="${ resource . toString ( ) } ">` )
149+ . join ( '\n' ) ;
148150
149- return `${ baseStyles . map ( href => `<link rel="stylesheet" type="text/css" href=" ${ href } ">` ) . join ( '\n' ) }
151+ return `${ baseStyles }
150152 ${ this . getSettingsOverrideStyles ( nonce , config ) }
151153 ${ this . computeCustomStyleSheetIncludes ( resource , config ) } ` ;
152154 }
153155
154156 private getScripts ( nonce : string ) : string {
155- const scripts = this . extensionPreviewResourceProvider . previewScripts . map ( resource => resource . toString ( ) ) ;
156- return scripts
157- . map ( source => `<script async src="${ source } " nonce="${ nonce } " charset="UTF-8"></script>` )
157+ return this . contributions . previewScripts
158+ . map ( resource => `<script async src="${ resource . toString ( ) } " nonce="${ nonce } " charset="UTF-8"></script>` )
158159 . join ( '\n' ) ;
159160 }
160161
0 commit comments