diff --git a/index.js b/index.js
index 52a2e69..41cc5b5 100644
--- a/index.js
+++ b/index.js
@@ -8,18 +8,19 @@ var contentTypes = {
".gif": "image/gif",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
+ ".svg": "image/svg+xml",
".bmp": "image/bmp",
".webp": "image/webp"
}
module.exports = function(html, base) {
base = base || process.cwd()
-
+
var dom = cheerio.load(String(html))
inlineImages(dom)
-
+
return new Buffer(dom.html({decodeEntities: false}))
-
+
function inlineImages(dom) {
var styles = [];
dom('img').each(function(idx, el) {
@@ -35,7 +36,7 @@ module.exports = function(html, base) {
}
})
}
-
+
function isLocal(href) {
return href && !url.parse(href).hostname;
}
diff --git a/package.json b/package.json
index d11b898..e889dbe 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "inline-images",
- "version": "1.0.1",
+ "version": "1.0.2",
"main": "index.js",
"bin": {
"inline-images": "cli.js"
@@ -9,7 +9,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
- "cheerio": "cheeriojs/cheerio"
+ "cheerio": "1.0.0-rc.10"
},
"author": "max ogden",
"license": "BSD",
diff --git a/readme.md b/readme.md
index 5fe69a0..7432d95 100644
--- a/readme.md
+++ b/readme.md
@@ -1,6 +1,8 @@
# inline-images
-transforms html and replaces img tags with data URIs, e.g.`
` tags with `
`
+Transforms html and replaces img tags with data URIs, e.g. `
` tags with `
`.
+
+Supports: PNG, GIF, JPG, SVG, BMP, WEBP
```
npm install inline-images -g