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

Commit 5df06cf

Browse files
author
Julien Gilli
committed
docs: clarify url.format documentation
The original documentation was slightly confusing. It seemed that the list of items described the properties of the urlObj object, while it was actually describing the formatting process. This change makes this clearer. Fixes #8796.
1 parent 0d05123 commit 5df06cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/api/url.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Pass `true` as the third argument to treat `//foo/bar` as
8181

8282
Take a parsed URL object, and return a formatted URL string.
8383

84+
Here's how the formatting process works:
85+
8486
* `href` will be ignored.
8587
* `protocol` is treated the same with or without the trailing `:` (colon).
8688
* The protocols `http`, `https`, `ftp`, `gopher`, `file` will be
@@ -95,9 +97,9 @@ Take a parsed URL object, and return a formatted URL string.
9597
* `port` will only be used if `host` is absent.
9698
* `host` will be used in place of `hostname` and `port`
9799
* `pathname` is treated the same with or without the leading `/` (slash)
98-
* `search` will be used in place of `query`
99100
* `query` (object; see `querystring`) will only be used if `search` is absent.
100-
* `search` is treated the same with or without the leading `?` (question mark)
101+
* `search` will be used in place of `query`.
102+
* It is treated the same with or without the leading `?` (question mark)
101103
* `hash` is treated the same with or without the leading `#` (pound sign, anchor)
102104

103105
## url.resolve(from, to)

0 commit comments

Comments
 (0)