Skip to content

Commit

Permalink
Fix highlight Markdown error.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhuyule committed Feb 6, 2018
1 parent 8d9f08c commit ca0e055
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function backtickCodeBlock(data) {
.replace(/{/g, '{')
.replace(/}/g, '}');

return start + content + (end ? '\n\n' : '');
return start + '<escape>' + content + '</escape>' + (end ? '\n\n' : '');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function backtickCodeBlock(data) {
.replace(/{/g, '&#123;')
.replace(/}/g, '&#125;');

return start + content + (end ? '\n\n' : '');
return start + '<escape>' + content + '</escape>' + (end ? '\n\n' : '');
});
}

Expand Down
2 changes: 0 additions & 2 deletions views/main/moe-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ $(() => {
let imgPathOld = path.join(imgManager.imgBaseDir,nameOld).replace(/\\/g,'/');
if (fs.existsSync(imgPathOld)) {
let content = editor.getValue();
console.log(1,content)
imgPathNew = imgPathNew.replace(/\\/g,'/');
fs.rename(imgPathOld, imgPathNew, err => {
if (err) log.error(err);
Expand All @@ -277,7 +276,6 @@ $(() => {
let relativePathOld = imgManager.relativePath(imgPathOld);
let relativePathNew = imgManager.relativePath(imgPathNew);
content = content.replace(new RegExp('\\]\\(' + relativePathOld + '\/', 'g'), '](' + relativePathNew + '/');
console.log(2,content)
editor.setValue(content)
imgManager.renameDirPath(nameNew);
})
Expand Down

0 comments on commit ca0e055

Please sign in to comment.