Skip to content

Commit cbcd035

Browse files
committed
修复内存溢出
1 parent 845ad13 commit cbcd035

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

build/compile.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,24 @@ marked.setOptions({
3232
renderer: renderer,
3333
gfm: true,
3434
tables: true,
35-
breaks: true,
35+
breaks: false,
3636
pedantic: false,
3737
sanitize: false,
3838
smartLists: true,
3939
smartypants: false,
4040
highlight: function (code, lang, callback) {
41-
if(lang){
42-
return callback('',highlight.highlight(lang,code).value);
43-
}else{
44-
return callback('',highlight.highlightAuto(code).value);
45-
}
41+
lang = lang?lang:"bash";
42+
return callback('',highlight.highlight(lang,code).value);
4643
}
44+
// highlight: function (code, lang, callback) {
45+
// if(lang){
46+
// return highlight.highlight(lang,code).value;
47+
// // return callback('',highlight.highlight(lang,code).value);
48+
// }else{
49+
// return highlight.highlightAuto(code).value;
50+
// // return callback('',highlight.highlightAuto(code).value);
51+
// }
52+
// }
4753
});
4854

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

8591
})
8692

93+
8794
// 监听实时编译
8895
watch.watchTree(path.join(path.dirname(__dirname),'/'), function (f, curr, prev) {
8996
if (typeof f == "object" && prev === null && curr === null) {
@@ -159,7 +166,8 @@ function ReadTmpToHTML(from_path,to_path,md_path,des_json){
159166
// 生成到指定目录
160167
var new_to_path = path.join(path.dirname(__dirname),to_path);
161168
// 循环创建目录
162-
mkdirsSync(path.dirname(new_to_path));
169+
!exists(path.dirname(new_to_path)) && mkdirsSync(path.dirname(new_to_path));
170+
163171
if(md_path){
164172
var new_md_path = path.join(path.dirname(__dirname),md_path);
165173
var README_str = fs.readFileSync(new_md_path);

0 commit comments

Comments
 (0)