Skip to content

Commit

Permalink
修复内存溢出
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 29, 2016
1 parent 845ad13 commit cbcd035
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions build/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,24 @@ marked.setOptions({
renderer: renderer,
gfm: true,
tables: true,
breaks: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
highlight: function (code, lang, callback) {
if(lang){
return callback('',highlight.highlight(lang,code).value);
}else{
return callback('',highlight.highlightAuto(code).value);
}
lang = lang?lang:"bash";
return callback('',highlight.highlight(lang,code).value);
}
// highlight: function (code, lang, callback) {
// if(lang){
// return highlight.highlight(lang,code).value;
// // return callback('',highlight.highlight(lang,code).value);
// }else{
// return highlight.highlightAuto(code).value;
// // return callback('',highlight.highlightAuto(code).value);
// }
// }
});

// 根目录
Expand Down Expand Up @@ -84,6 +90,7 @@ CreateDatajs('./.deploy/js/dt.js',function(dt_path,arr){

})


// 监听实时编译
watch.watchTree(path.join(path.dirname(__dirname),'/'), function (f, curr, prev) {
if (typeof f == "object" && prev === null && curr === null) {
Expand Down Expand Up @@ -159,7 +166,8 @@ function ReadTmpToHTML(from_path,to_path,md_path,des_json){
// 生成到指定目录
var new_to_path = path.join(path.dirname(__dirname),to_path);
// 循环创建目录
mkdirsSync(path.dirname(new_to_path));
!exists(path.dirname(new_to_path)) && mkdirsSync(path.dirname(new_to_path));

if(md_path){
var new_md_path = path.join(path.dirname(__dirname),md_path);
var README_str = fs.readFileSync(new_md_path);
Expand Down

0 comments on commit cbcd035

Please sign in to comment.