We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e89ba5 commit f5101adCopy full SHA for f5101ad
build/crawler.js
@@ -25,7 +25,18 @@ function CreatMarkdown(from_path,to_path){
25
26
request.get(from_path).end(function(err, res){
27
// console.log("to_path::",to_path)
28
- fs.writeFileSync(to_path, toMarkdown(res.text).toString() ,'utf-8');
+ var md_str = res.text
29
+
30
+ md_str = md_str.replace(/<pre>/gi,'```\n')
31
+ md_str = md_str.replace(/<\/pre>/gi,'\n```')
32
+ md_str = md_str.replace(/<span.*?>/gi,'')
33
+ md_str = md_str.replace(/<\/span>/gi,'')
34
+ md_str = md_str.replace(/\[[^\]]*\]\(.*?\)/g,function(str){
35
+ str.replace(/\[(.*?)\]/,'');
36
+ return RegExp.$1;
37
+ })
38
39
+ fs.writeFileSync(to_path, toMarkdown(md_str).toString() ,'utf-8');
40
console.log(" → ",to_path)
41
});
42
0 commit comments