@@ -16,21 +16,21 @@ When parsed, a URL object is returned containing properties for each of these
1616components.
1717
1818The following details each of the components of a parsed URL. The example
19- ` 'http://user:pass@host.com:8080/p/a/t/h?query=string#hash' ` is used to
19+ ` 'http://user:pass@sub. host.com:8080/p/a/t/h?query=string#hash' ` is used to
2020illustrate each.
2121
2222``` txt
23- ┌─────────────────────────────────────────────────────────────────────────────┐
24- │ href │
25- ├──────────┬┬───────────┬─────────────────┬───────────────────────────┬───────┤
26- │ protocol ││ auth │ host │ path │ hash │
27- │ ││ ├──────────┬──────┼──────────┬────────────────┤ │
28- │ ││ │ hostname │ port │ pathname │ search │ │
29- │ ││ │ │ │ ├─┬──────────────┤ │
30- │ ││ │ │ │ │ │ query │ │
31- " http: // user:pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
32- │ ││ │ │ │ │ │ │ │
33- └──────────┴┴───────────┴──────────┴──────┴──────────┴─┴──────────────┴───────┘
23+ ┌───────────────────────────────────────────────────────────────────────────────── ┐
24+ │ href │
25+ ├──────────┬┬───────────┬───────────────────── ┬───────────────────────────┬───────┤
26+ │ protocol ││ auth │ host │ path │ hash │
27+ │ ││ ├────────────── ┬──────┼──────────┬────────────────┤ │
28+ │ ││ │ hostname │ port │ pathname │ search │ │
29+ │ ││ │ │ │ ├─┬──────────────┤ │
30+ │ ││ │ │ │ │ │ query │ │
31+ " http: // user:pass @ sub. host.com : 8080 /p/a/t/h ? query=string #hash "
32+ │ ││ │ │ │ │ │ │ │
33+ └──────────┴┴───────────┴────────────── ┴──────┴──────────┴─┴──────────────┴───────┘
3434(all spaces in the "" line should be ignored -- they are purely for formatting)
3535```
3636
@@ -56,21 +56,21 @@ For example: `'#hash'`
5656The ` host ` property is the full lower-cased host portion of the URL, including
5757the ` port ` if specified.
5858
59- For example: ` 'host.com:8080' `
59+ For example: ` 'sub. host.com:8080' `
6060
6161### urlObject.hostname
6262
6363The ` hostname ` property is the lower-cased host name portion of the ` host `
6464component * without* the ` port ` included.
6565
66- For example: ` 'host.com' `
66+ For example: ` 'sub. host.com' `
6767
6868### urlObject.href
6969
7070The ` href ` property is the full URL string that was parsed with both the
7171` protocol ` and ` host ` components converted to lower-case.
7272
73- For example: ` 'http://user:pass@host.com:8080/p/a/t/h?query=string#hash' `
73+ For example: ` 'http://user:pass@sub. host.com:8080/p/a/t/h?query=string#hash' `
7474
7575### urlObject.path
7676
@@ -328,31 +328,31 @@ console.log(myURL.pathname); // /foo
328328` delete myURL.pathname ` , etc) has no effect but will still return ` true ` .
329329
330330A comparison between this API and ` url.parse() ` is given below. Above the URL
331- ` 'http://user:pass@host.com:8080/p/a/t/h?query=string#hash' ` , properties of an
331+ ` 'http://user:pass@sub. host.com:8080/p/a/t/h?query=string#hash' ` , properties of an
332332object returned by ` url.parse() ` are shown. Below it are properties of a WHATWG
333333` URL ` object.
334334
335335* Note* : WHATWG URL's ` origin ` property includes ` protocol ` and ` host ` , but not
336336` username ` or ` password ` .
337337
338338``` txt
339- ┌─────────────────────────────────────────────────────────────────────────────────────────┐
340- │ href │
341- ├──────────┬──┬─────────────────────┬─────────────────┬───────────────────────────┬───────┤
342- │ protocol │ │ auth │ host │ path │ hash │
343- │ │ │ ├──────────┬──────┼──────────┬────────────────┤ │
344- │ │ │ │ hostname │ port │ pathname │ search │ │
345- │ │ │ │ │ │ ├─┬──────────────┤ │
346- │ │ │ │ │ │ │ │ query │ │
347- " http: // user : pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
348- │ │ │ │ │ hostname │ port │ │ │ │
349- │ │ │ │ ├──────────┴──────┤ │ │ │
350- │ protocol │ │ username │ password │ host │ │ │ │
351- ├──────────┴──┼──────────┴──────────┼─────────────────┤ │ │ │
352- │ origin │ │ origin │ pathname │ search │ hash │
353- ├─────────────┴─────────────────────┴─────────────────┴──────────┴────────────────┴───────┤
354- │ href │
355- └─────────────────────────────────────────────────────────────────────────────────────────┘
339+ ┌───────────────────────────────────────────────────────────────────────────────────────────── ┐
340+ │ href │
341+ ├──────────┬──┬─────────────────────┬───────────────────── ┬───────────────────────────┬───────┤
342+ │ protocol │ │ auth │ host │ path │ hash │
343+ │ │ │ ├────────────── ┬──────┼──────────┬────────────────┤ │
344+ │ │ │ │ hostname │ port │ pathname │ search │ │
345+ │ │ │ │ │ │ ├─┬──────────────┤ │
346+ │ │ │ │ │ │ │ │ query │ │
347+ " http: // user : pass @ sub. host.com : 8080 /p/a/t/h ? query=string #hash "
348+ │ │ │ │ │ hostname │ port │ │ │ │
349+ │ │ │ │ ├────────────── ┴──────┤ │ │ │
350+ │ protocol │ │ username │ password │ host │ │ │ │
351+ ├──────────┴──┼──────────┴──────────┼───────────────────── ┤ │ │ │
352+ │ origin │ │ origin │ pathname │ search │ hash │
353+ ├─────────────┴─────────────────────┴───────────────────── ┴──────────┴────────────────┴───────┤
354+ │ href │
355+ └───────────────────────────────────────────────────────────────────────────────────────────── ┘
356356(all spaces in the "" line should be ignored -- they are purely for formatting)
357357```
358358
0 commit comments