mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 15:24:43 +00:00
replace smart-quotes with regular quotes
This commit is contained in:
parent
7d4aee31bb
commit
fd6e5e3f31
3 changed files with 11 additions and 2 deletions
5
gdocs.js
5
gdocs.js
|
|
@ -64,6 +64,11 @@ function download(name, url) {
|
||||||
// strip out all text annotations
|
// strip out all text annotations
|
||||||
data = data.replace(/\[\w{1,3}\]/mg, '');
|
data = data.replace(/\[\w{1,3}\]/mg, '');
|
||||||
|
|
||||||
|
// fix smart-quotes
|
||||||
|
data = data.replace(/[“”]/g, '"');
|
||||||
|
data = data.replace(/[‘’]/g, "'");
|
||||||
|
|
||||||
|
|
||||||
data = data + '\n';
|
data = data + '\n';
|
||||||
fs.writeFileSync('docs/' + name, reflow(data, 100));
|
fs.writeFileSync('docs/' + name, reflow(data, 100));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ function angularServiceInject(name, fn, inject, eager) {
|
||||||
* extracting all arguments which start with $ or end with _ as the
|
* extracting all arguments which start with $ or end with _ as the
|
||||||
* injection names.
|
* injection names.
|
||||||
*/
|
*/
|
||||||
var FN_ARGS = /^function [^\(]*\(([^\)]*)\)/;
|
var FN_ARGS = /^function\s*[^\(]*\(([^\)]*)\)/;
|
||||||
var FN_ARG_SPLIT = /,/;
|
var FN_ARG_SPLIT = /,/;
|
||||||
var FN_ARG = /^\s*(((\$?).+?)(_?))\s*$/;
|
var FN_ARG = /^\s*(((\$?).+?)(_?))\s*$/;
|
||||||
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
|
||||||
|
|
|
||||||
|
|
@ -65,11 +65,15 @@ describe('injector', function(){
|
||||||
fn.$inject = ['a'];
|
fn.$inject = ['a'];
|
||||||
expect(injectionArgs(fn)).toBe(fn.$inject);
|
expect(injectionArgs(fn)).toBe(fn.$inject);
|
||||||
expect(injectionArgs(function(){})).toEqual([]);
|
expect(injectionArgs(function(){})).toEqual([]);
|
||||||
|
expect(injectionArgs(function (){})).toEqual([]);
|
||||||
|
expect(injectionArgs(function (){})).toEqual([]);
|
||||||
|
expect(injectionArgs(function /* */ (){})).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create $inject', function(){
|
it('should create $inject', function(){
|
||||||
// keep the multi-line to make sure we can handle it
|
// keep the multi-line to make sure we can handle it
|
||||||
function $f_n0(
|
function $f_n0 /*
|
||||||
|
*/(
|
||||||
$a, // x, <-- looks like an arg but it is a comment
|
$a, // x, <-- looks like an arg but it is a comment
|
||||||
b_, /* z, <-- looks like an arg but it is a
|
b_, /* z, <-- looks like an arg but it is a
|
||||||
multi-line comment
|
multi-line comment
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue