Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2f7c572

Browse files
docs(bike-shed-migration): let markdown deal with extenal links
It is problematic to use {@link} tags with external links because the markdown parser converts them to links for us before we parse the @links. This means that the following tag: ``` {@link http://www.google.com Google} ``` get converted to: ``` {@link <a href="http://www.google.com/"></a> Google} ``` Our {@link} parser then converts this to: ``` <a href="<a">&lt;</a>href="http://www.google.com/"></a> Google} ``` which is clearly a mess. The best solution is not to use {@link} tags for external links and just use the standard markdown syntax: ``` [Google](http://www.google.com) ``` In the long run, we could look into configuring or modifying `marked` not to convert these external links or we could provide a "pre-parser" processor that dealt with such links before `marked` gets its hands on it.
1 parent 1192ae4 commit 2f7c572

File tree

12 files changed

+36
-38
lines changed

12 files changed

+36
-38
lines changed

src/ng/anchorScroll.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @description
1212
* When called, it checks current value of `$location.hash()` and scroll to related element,
1313
* according to rules specified in
14-
* {@link http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document Html5 spec}.
14+
* [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).
1515
*
1616
* It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor.
1717
* This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.

src/ng/controller.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ function $ControllerProvider() {
5555
* `$controller` service is responsible for instantiating controllers.
5656
*
5757
* It's just a simple call to {@link auto.$injector $injector}, but extracted into
58-
* a service, so that one can override this service with {@link https://gist.github.com/1649788
59-
* BC version}.
58+
* a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
6059
*/
6160
return function(expression, locals) {
6261
var instance, match, constructor, identifier;

src/ng/directive/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
12091209
*
12101210
* For best practices on using `ngModel`, see:
12111211
*
1212-
* - {@link https://github.com/angular/angular.js/wiki/Understanding-Scopes}
1212+
* - [https://github.com/angular/angular.js/wiki/Understanding-Scopes]
12131213
*
12141214
* For basic examples, how to use `ngModel`, see:
12151215
*

src/ng/directive/ngIf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Note that when an element is removed using `ngIf` its scope is destroyed and a new scope
2020
* is created when the element is restored. The scope created within `ngIf` inherits from
2121
* its parent scope using
22-
* {@link https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance prototypal inheritance}.
22+
* [prototypal inheritance](https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance).
2323
* An important implication of this is if `ngModel` is used within `ngIf` to bind to
2424
* a javascript primitive defined in the parent scope. In this case any modifications made to the
2525
* variable within the child scope will override (hide) the value in the parent scope.

src/ng/directive/ngInclude.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
* application document. This is done by calling {@link ng.$sce#methods_getTrustedResourceUrl
1313
* $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols
1414
* you may either {@link ng.$sceDelegateProvider#methods_resourceUrlWhitelist whitelist them} or
15-
* {@link ng.$sce#methods_trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link
15+
* [wrap them](ng.$sce#methods_trustAsResourceUrl) as trusted values. Refer to Angular's {@link
1616
* ng.$sce Strict Contextual Escaping}.
1717
*
1818
* In addition, the browser's
19-
* {@link https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest
20-
* Same Origin Policy} and {@link http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing
21-
* (CORS)} policy may further restrict whether the template is successfully loaded.
19+
* [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
20+
* and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
21+
* policy may further restrict whether the template is successfully loaded.
2222
* For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`
2323
* access on some browsers.
2424
*

src/ng/directive/ngPluralize.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
* These rules are bundled with angular.js, but can be overridden
1212
* (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive
1313
* by specifying the mappings between
14-
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
15-
* plural categories} and the strings to be displayed.
14+
* [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
15+
* and the strings to be displayed.
1616
*
1717
* # Plural categories and explicit number rules
1818
* There are two
19-
* {@link http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
20-
* plural categories} in Angular's default en-US locale: "one" and "other".
19+
* [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
20+
* in Angular's default en-US locale: "one" and "other".
2121
*
2222
* While a plural category may match many numbers (for example, in en-US locale, "other" can match
2323
* any number that is not 1), an explicit number rule can only match one number. For example, the

src/ng/directive/select.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var ngOptionsMinErr = minErr('ngOptions');
2121
*
2222
* <div class="alert alert-warning">
2323
* **Note:** `ngModel` compares by reference, not value. This is important when binding to an
24-
* array of objects. See an example {@link http://jsfiddle.net/qWzTb/ in this jsfiddle}.
24+
* array of objects. See an example [in this jsfiddle](http://jsfiddle.net/qWzTb/).
2525
* </div>
2626
*
2727
* Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can

src/ng/http.js

+13-14
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ function $HttpProvider() {
183183
*
184184
* @description
185185
* The `$http` service is a core Angular service that facilitates communication with the remote
186-
* HTTP servers via the browser's {@link https://developer.mozilla.org/en/xmlhttprequest
187-
* XMLHttpRequest} object or via {@link http://en.wikipedia.org/wiki/JSONP JSONP}.
186+
* HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)
187+
* object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).
188188
*
189189
* For unit testing applications that use `$http` service, see
190190
* {@link ngMock.$httpBackend $httpBackend mock}.
@@ -473,19 +473,18 @@ function $HttpProvider() {
473473
*
474474
* When designing web applications, consider security threats from:
475475
*
476-
* - {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
477-
* JSON vulnerability}
478-
* - {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF}
476+
* - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
477+
* - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)
479478
*
480479
* Both server and the client must cooperate in order to eliminate these threats. Angular comes
481480
* pre-configured with strategies that address these issues, but for this to work backend server
482481
* cooperation is required.
483482
*
484483
* ## JSON Vulnerability Protection
485484
*
486-
* A {@link http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx
487-
* JSON vulnerability} allows third party website to turn your JSON resource URL into
488-
* {@link http://en.wikipedia.org/wiki/JSONP JSONP} request under some conditions. To
485+
* A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
486+
* allows third party website to turn your JSON resource URL into
487+
* [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To
489488
* counter this your server can prefix all JSON requests with following string `")]}',\n"`.
490489
* Angular will automatically strip the prefix before processing it as JSON.
491490
*
@@ -505,7 +504,7 @@ function $HttpProvider() {
505504
*
506505
* ## Cross Site Request Forgery (XSRF) Protection
507506
*
508-
* {@link http://en.wikipedia.org/wiki/Cross-site_request_forgery XSRF} is a technique by which
507+
* [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which
509508
* an unauthorized site can gain your user's private data. Angular provides a mechanism
510509
* to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
511510
* (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only
@@ -519,7 +518,7 @@ function $HttpProvider() {
519518
* that only JavaScript running on your domain could have sent the request. The token must be
520519
* unique for each user and must be verifiable by the server (to prevent the JavaScript from
521520
* making up its own tokens). We recommend that the token is a digest of your site's
522-
* authentication cookie with a {@link https://en.wikipedia.org/wiki/Salt_(cryptography) salt}
521+
* authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))
523522
* for added security.
524523
*
525524
* The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
@@ -556,10 +555,10 @@ function $HttpProvider() {
556555
* - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}
557556
* that should abort the request when resolved.
558557
* - **withCredentials** - `{boolean}` - whether to to set the `withCredentials` flag on the
559-
* XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5
560-
* requests with credentials} for more information.
561-
* - **responseType** - `{string}` - see {@link
562-
* https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}.
558+
* XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5
559+
* for more information.
560+
* - **responseType** - `{string}` - see
561+
* [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
563562
*
564563
* @returns {HttpPromise} Returns a {@link ng.$q promise} object with the
565564
* standard `then` method and two http specific methods: `success` and `error`. The `then`

src/ng/location.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ LocationHashbangInHtml5Url.prototype =
295295
* This method is getter only.
296296
*
297297
* Return full url representation with all segments encoded according to rules specified in
298-
* {@link http://www.ietf.org/rfc/rfc3986.txt RFC 3986}.
298+
* [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
299299
*
300300
* @return {string} full url
301301
*/
@@ -495,7 +495,7 @@ function locationGetterSetter(property, preprocess) {
495495
*
496496
* @description
497497
* The $location service parses the URL in the browser address bar (based on the
498-
* {@link https://developer.mozilla.org/en/window.location window.location}) and makes the URL
498+
* [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL
499499
* available to your application. Changes to the URL in the address bar are reflected into
500500
* $location service and changes to $location are reflected into the browser address bar.
501501
*

src/ng/sce.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ function $SceDelegateProvider() {
485485
*
486486
* *Please note*:
487487
* The browser's
488-
* {@link https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest
489-
* Same Origin Policy} and {@link http://www.w3.org/TR/cors/ Cross-Origin Resource Sharing (CORS)}
488+
* [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
489+
* and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
490490
* policy apply in addition to this and may further restrict whether the template is successfully
491491
* loaded. This means that without the right CORS policy, loading templates from a different domain
492492
* won't work on all browsers. Also, loading templates from `file://` URL does not work on some

src/ngMock/angular-mocks.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ angular.mock.dump = function(object) {
869869
* development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.
870870
*
871871
* During unit testing, we want our unit tests to run quickly and have no external dependencies so
872-
* we don’t want to send {@link https://developer.mozilla.org/en/xmlhttprequest XHR} or
873-
* {@link http://en.wikipedia.org/wiki/JSONP JSONP} requests to a real server. All we really need is
872+
* we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or
873+
* [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is
874874
* to verify whether a certain request has been sent or not, or alternatively just let the
875875
* application make requests, respond with pre-trained responses and assert that the end result is
876876
* what we expect it to be.

src/ngResource/resource.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ function shallowClearAndCopy(src, dst) {
134134
* - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
135135
* should abort the request when resolved.
136136
* - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
137-
* XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5
138-
* requests with credentials} for more information.
139-
* - **`responseType`** - `{string}` - see {@link
140-
* https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}.
137+
* XHR object. See [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
138+
* for more information.
139+
* - **`responseType`** - `{string}` - see
140+
* [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
141141
* - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
142142
* `response` and `responseError`. Both `response` and `responseError` interceptors get called
143143
* with `http response` object. See {@link ng.$http $http interceptors}.

0 commit comments

Comments
 (0)