Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cbcd035

Browse filesBrowse files
committed
修复内存溢出
1 parent 845ad13 commit cbcd035
Copy full SHA for cbcd035

1 file changed

+15-7Lines changed: 15 additions & 7 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎build/compile.js‎

Copy file name to clipboardExpand all lines: build/compile.js
+15-7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.