This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ fun! s:serverClose() abort "function for close the server
107107endfu
108108
109109fun ! s: browserStart () abort " function for opening the browser
110- let g: mkdp_cwd = expand (' %:p:h ' )
110+ let g: mkdp_cwd = expand (' %:p' )
111111
112112 " py2/py3 different resolve for str
113113 if g: mkdp_py_version == 2
Original file line number Diff line number Diff line change 77 html = document . querySelector ( 'html' ) ;
88 mkdContainer = document . getElementById ( 'js-markdown' ) ;
99
10+ function updateTitle ( ) {
11+ var fileName = Base64 . decode ( location . search . slice ( 1 ) ) . split ( '/' ) . pop ( ) ;
12+ var title = document . getElementsByTagName ( 'title' ) [ 0 ] ;
13+ title . innerHTML = fileName ;
14+ }
15+
1016 function fixAllImg ( text ) {
1117 var match , reg = / < i m g [ ^ > ] + ?( s r c = ( " | ' ) ( [ ^ \2] + ?) \2) [ ^ > ] + ?> / g;
1218 while ( ( match = reg . exec ( text ) ) !== null ) {
1824 }
1925
2026 function getAbsPath ( base , path ) {
21- var bases = Base64 . decode ( base . slice ( 1 ) ) . split ( '/' )
27+ var bases = Base64 . decode ( base . slice ( 1 ) ) . split ( '/' ) . slice ( 0 , - 1 ) ;
2228 var paths = path . split ( '/' ) ;
2329 if ( / ^ h t t p s ? : ? / i. test ( paths [ 0 ] ) ) {
2430 return path ;
208214 }
209215
210216 function winClose ( ) {
211- window . close ( )
217+ window . close ( ) ;
212218 }
213219
220+ updateTitle ( ) ;
214221 openConn ( ) ;
215222
216223} ) ( this ) ;
You can’t perform that action at this time.
0 commit comments