Skip to content

Commit c89e5c4

Browse files
authored
Merge pull request #46 from daveycakes/readme
Added more details for options.url in README
2 parents 2ec9ce9 + 4b90941 commit c89e5c4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,25 @@ Whether to remove the original `<link rel="stylesheet">` tags after (possibly) i
148148
Type: `String`
149149
Default: `filePath`
150150

151-
How to resolve hrefs.
151+
How to resolve hrefs. Must be a string of one character or more. **Required**.
152+
153+
Relative urls in links will have this value prepended to them. So these links:
154+
* `<a href="page-relative">Page</a>`
155+
* `<a href="/root-relative">Root</a>` <- _note leading /_
156+
157+
158+
With this option:
159+
```js
160+
inlineCss(html, { url: 'http://example.com/mushroom'})
161+
.then(function(html) { console.log(html); });
162+
```
163+
164+
Will result in
165+
166+
* `<a href="http://example.com/mushroom/page-relative">Page</a>`
167+
* `<a href="http://example.com/root-relative">Root</a>`
168+
169+
If you don't need this feature, simply set the property to a short string eg `{url: ' '}` (one space) and everything will work.
152170

153171
#### options.preserveMediaQueries
154172

0 commit comments

Comments
 (0)