@@ -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
@@ -324,31 +324,31 @@ console.log(myURL.pathname); // /foo
324324` delete myURL.pathname ` , etc) has no effect but will still return ` true ` .
325325
326326A comparison between this API and ` url.parse() ` is given below. Above the URL
327- ` 'http://user:pass@host.com:8080/p/a/t/h?query=string#hash' ` , properties of an
327+ ` 'http://user:pass@sub. host.com:8080/p/a/t/h?query=string#hash' ` , properties of an
328328object returned by ` url.parse() ` are shown. Below it are properties of a WHATWG
329329` URL ` object.
330330
331331* Note* : WHATWG URL's ` origin ` property includes ` protocol ` and ` host ` , but not
332332` username ` or ` password ` .
333333
334334``` txt
335- ┌─────────────────────────────────────────────────────────────────────────────────────────┐
336- │ href │
337- ├──────────┬──┬─────────────────────┬─────────────────┬───────────────────────────┬───────┤
338- │ protocol │ │ auth │ host │ path │ hash │
339- │ │ │ ├──────────┬──────┼──────────┬────────────────┤ │
340- │ │ │ │ hostname │ port │ pathname │ search │ │
341- │ │ │ │ │ │ ├─┬──────────────┤ │
342- │ │ │ │ │ │ │ │ query │ │
343- " http: // user : pass @ host.com : 8080 /p/a/t/h ? query=string #hash "
344- │ │ │ │ │ hostname │ port │ │ │ │
345- │ │ │ │ ├──────────┴──────┤ │ │ │
346- │ protocol │ │ username │ password │ host │ │ │ │
347- ├──────────┴──┼──────────┴──────────┼─────────────────┤ │ │ │
348- │ origin │ │ origin │ pathname │ search │ hash │
349- ├─────────────┴─────────────────────┴─────────────────┴──────────┴────────────────┴───────┤
350- │ href │
351- └─────────────────────────────────────────────────────────────────────────────────────────┘
335+ ┌───────────────────────────────────────────────────────────────────────────────────────────── ┐
336+ │ href │
337+ ├──────────┬──┬─────────────────────┬───────────────────── ┬───────────────────────────┬───────┤
338+ │ protocol │ │ auth │ host │ path │ hash │
339+ │ │ │ ├────────────── ┬──────┼──────────┬────────────────┤ │
340+ │ │ │ │ hostname │ port │ pathname │ search │ │
341+ │ │ │ │ │ │ ├─┬──────────────┤ │
342+ │ │ │ │ │ │ │ │ query │ │
343+ " http: // user : pass @ sub. host.com : 8080 /p/a/t/h ? query=string #hash "
344+ │ │ │ │ │ hostname │ port │ │ │ │
345+ │ │ │ │ ├────────────── ┴──────┤ │ │ │
346+ │ protocol │ │ username │ password │ host │ │ │ │
347+ ├──────────┴──┼──────────┴──────────┼───────────────────── ┤ │ │ │
348+ │ origin │ │ origin │ pathname │ search │ hash │
349+ ├─────────────┴─────────────────────┴───────────────────── ┴──────────┴────────────────┴───────┤
350+ │ href │
351+ └───────────────────────────────────────────────────────────────────────────────────────────── ┘
352352(all spaces in the "" line should be ignored -- they are purely for formatting)
353353```
354354
0 commit comments