@@ -563,7 +563,7 @@ function readStyles() {
563
563
var href = filename = styles [ i ] ;
564
564
var protocol = url . parse ( href ) . protocol ;
565
565
if ( protocol === 'http:' || protocol === 'https:' ) {
566
- style += '<link rel=\"stylesheet\" href=\"" + href + " \" type=\"text/css\">' ;
566
+ style += '<link rel=\"stylesheet\" href=\"' + href + ' \" type=\"text/css\">';
567
567
} else if ( protocol === 'file:' ) {
568
568
style += makeCss ( filename ) ;
569
569
}
@@ -595,15 +595,22 @@ function readStyles() {
595
595
styles = vscode . workspace . getConfiguration ( 'markdown-pdf' ) [ 'styles' ] || '' ;
596
596
if ( styles && Array . isArray ( styles ) && styles . length > 0 ) {
597
597
for ( i = 0 ; i < styles . length ; i ++ ) {
598
- filename = styles [ i ] ;
598
+ var href = filename = styles [ i ] ;
599
+ var protocol = url . parse ( href ) . protocol ;
599
600
if ( ! path . isAbsolute ( filename ) ) {
600
- if ( vscode . workspace . rootPath == undefined ) {
601
- filename = path . join ( path . dirname ( mdfilename ) , filename ) ;
601
+ if ( protocol === 'http:' || protocol === 'https:' ) {
602
+ style += '<link rel=\"stylesheet\" href=\"' + href + '\" type=\"text/css\">' ;
602
603
} else {
603
- filename = path . join ( vscode . workspace . rootPath , filename ) ;
604
+ if ( vscode . workspace . rootPath == undefined ) {
605
+ filename = path . join ( path . dirname ( mdfilename ) , filename ) ;
606
+ } else {
607
+ filename = path . join ( vscode . workspace . rootPath , filename ) ;
608
+ }
609
+ style += makeCss ( filename ) ;
604
610
}
611
+ } else {
612
+ style += makeCss ( filename ) ;
605
613
}
606
- style += makeCss ( filename ) ;
607
614
}
608
615
}
609
616
0 commit comments