summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Gilli <julien.gilli@joyent.com>2014-12-01 12:27:33 -0800
committerJulien Gilli <julien.gilli@joyent.com>2014-12-15 12:29:36 -0800
commit0603c8345b7c40f9723277d5ae1f44041627dbab (patch)
treece698fce9af2f6c6a969e3a88b5f94381487ac12
parentd230fa9eb7364edac09f65a27e11718671d8e773 (diff)
downloadnode-0603c8345b7c40f9723277d5ae1f44041627dbab.tar.gz
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. Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
-rw-r--r--doc/api/url.markdown6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/api/url.markdown b/doc/api/url.markdown
index 6aa6863ec..e1d2557b8 100644
--- a/doc/api/url.markdown
+++ b/doc/api/url.markdown
@@ -81,6 +81,8 @@ Pass `true` as the third argument to treat `//foo/bar` as
Take a parsed URL object, and return a formatted URL string.
+Here's how the formatting process works:
+
* `href` will be ignored.
* `protocol` is treated the same with or without the trailing `:` (colon).
* The protocols `http`, `https`, `ftp`, `gopher`, `file` will be
@@ -95,9 +97,9 @@ Take a parsed URL object, and return a formatted URL string.
* `port` will only be used if `host` is absent.
* `host` will be used in place of `hostname` and `port`
* `pathname` is treated the same with or without the leading `/` (slash)
-* `search` will be used in place of `query`
* `query` (object; see `querystring`) will only be used if `search` is absent.
-* `search` is treated the same with or without the leading `?` (question mark)
+* `search` will be used in place of `query`.
+ * It is treated the same with or without the leading `?` (question mark)
* `hash` is treated the same with or without the leading `#` (pound sign, anchor)
## url.resolve(from, to)