Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 095c946

Browse files
committed
update
1 parent a25dcdd commit 095c946

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

autoload/mkdp.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fun! s:serverClose() abort "function for close the server
107107
endfu
108108

109109
fun! 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

autoload/server/static/scripts/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
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 = /<img[^>]+?(src=("|')([^\2]+?)\2)[^>]+?>/g;
1218
while((match = reg.exec(text)) !== null) {
@@ -18,7 +24,7 @@
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(/^https?:?/i.test(paths[0])) {
2430
return path;
@@ -208,9 +214,10 @@
208214
}
209215

210216
function winClose() {
211-
window.close()
217+
window.close();
212218
}
213219

220+
updateTitle();
214221
openConn();
215222

216223
})(this);

0 commit comments

Comments
 (0)