From b91c535d86084ecf493856c88fd2b2982d6df5c7 Mon Sep 17 00:00:00 2001 From: Julien Gilli Date: Sat, 10 Jan 2015 21:41:12 +0100 Subject: [PATCH] doc: 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. Reviewed-by: Chris Dickinson Cherry-picked-from: https://github.com/joyent/node/commit/0603c8345b7c40f9723277d5ae1f44041627dbab --- doc/api/url.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/url.markdown b/doc/api/url.markdown index 3ace6995794..ef24a2a3bc9 100644 --- a/doc/api/url.markdown +++ b/doc/api/url.markdown @@ -82,6 +82,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 @@ -97,9 +99,9 @@ Take a parsed URL object, and return a formatted URL string. * `host` will be used in place of `hostname` and `port` * `pathname` is treated the same with or without the leading `/` (slash). * `path` is treated the same with `pathname` but able to contain `query` as well. -* `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)