File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## 0.1.7 (2017/xx/xx)
4
4
* Fix: broken code-blocks [ #18 ] ( https://github.com/yzane/vscode-markdown-pdf/pull/18 )
5
+ * Fix: Image path error [ #14 ] ( https://github.com/yzane/vscode-markdown-pdf/issues/14 )
5
6
6
7
## 0.1.6 (2017/02/05)
7
8
* Fix: Relative path error of markdown-pdf.styles [ #9 ] ( https://github.com/yzane/vscode-markdown-pdf/issues/9 )
Original file line number Diff line number Diff line change @@ -359,14 +359,16 @@ function readFile(filename, encode) {
359
359
function convertImgPath ( src , filename ) {
360
360
var href = decodeURIComponent ( src ) ;
361
361
href = href . replace ( / ( " | ' ) / g, '' )
362
- . replace ( / \\ / g, '/' ) ;
362
+ . replace ( / \\ / g, '/' )
363
+ . replace ( / # / g, '%23' ) ;
363
364
var protocol = url . parse ( href ) . protocol ;
364
365
if ( protocol === 'file:' && href . indexOf ( 'file:///' ) !== 0 ) {
365
366
return href . replace ( / ^ f i l e : \/ \/ / , 'file:///' ) ;
366
367
} else if ( protocol === 'file:' ) {
367
368
return href ;
368
369
} else if ( ! protocol || path . isAbsolute ( href ) ) {
369
- href = path . resolve ( path . dirname ( filename ) , href ) . replace ( / \\ / g, '/' ) ;
370
+ href = path . resolve ( path . dirname ( filename ) , href ) . replace ( / \\ / g, '/' )
371
+ . replace ( / # / g, '%23' ) ;
370
372
if ( href . indexOf ( '//' ) === 0 ) {
371
373
return 'file:' + href ;
372
374
} else if ( href . indexOf ( '/' ) === 0 ) {
You can’t perform that action at this time.
0 commit comments