mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
Remove removing old comments from gdocs
There were two places where we were removing old comments from google docs: * gdocs.js fetching script * docs/src/reader.js
This commit is contained in:
parent
517ada2662
commit
e670a812fa
2 changed files with 1 additions and 26 deletions
|
|
@ -48,26 +48,7 @@ function findNgDocInDir(directory, docNotify) {
|
|||
fs.readFile(directory + '/' + file, docNotify.waitFor(function(err, content){
|
||||
if (err) return this.error(err);
|
||||
var section = '@section ' + directory.split('/').pop() + '\n';
|
||||
|
||||
//TEMPORARY FIX to strip stuff from the docs until gdocs api is fixed
|
||||
var text = content.toString();
|
||||
|
||||
text = text.replace('\ufeff', '');
|
||||
text = text.replace(/\r\n/mg, '\n');
|
||||
text = text.replace(/^ /mg, ' '); //for some reason gdocs drop first space for indented lines
|
||||
|
||||
// strip out all text annotation comments
|
||||
text = text.replace(/^\[a\][\S\s]*/m, '');
|
||||
|
||||
// strip out all text annotations
|
||||
text = text.replace(/\[\w{1,3}\]/mg, '');
|
||||
|
||||
// fix smart-quotes
|
||||
text = text.replace(/[“”]/g, '"');
|
||||
text = text.replace(/[‘’]/g, "'");
|
||||
//TEMPORARY FIX END
|
||||
|
||||
docNotify(section + text, directory + '/' +file, 1);
|
||||
docNotify(section + content.toString(), directory + '/' +file, 1);
|
||||
}));
|
||||
} else if(stats.isDirectory()) {
|
||||
findNgDocInDir(directory + '/' + file, docNotify.waitFor(docNotify));
|
||||
|
|
|
|||
6
gdocs.js
6
gdocs.js
|
|
@ -73,12 +73,6 @@ function download(collection, name, url) {
|
|||
data = data.replace('\ufeff', '');
|
||||
data = data.replace(/\r\n/mg, '\n');
|
||||
|
||||
// strip out all text annotation comments
|
||||
data = data.replace(/^\[a\][\S\s]*/m, '');
|
||||
|
||||
// strip out all text annotations
|
||||
data = data.replace(/\[\w{1,3}\]/mg, '');
|
||||
|
||||
// strip out all docos comments
|
||||
data = data.replace(/^[^\s_]+:\n\S+[\S\s]*$/m, '')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue