aboutsummaryrefslogtreecommitdiff
path: root/lib/images.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-10-13 23:29:41 +0100
committerMichael Williamson <mike@zwobble.org>2015-10-13 23:49:31 +0100
commit7b7ce0d563ddc07172b0f241a5c3baf344f256e8 (patch)
tree43f5fddf920d47e281a30139bde99da5a689d667 /lib/images.js
parente04d054a1b414e843fa6d6f5ee1ae75c0df533b1 (diff)
Collapse similar HTML elements
Diffstat (limited to 'lib/images.js')
-rw-r--r--lib/images.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/images.js b/lib/images.js
index 613a264..d7c2ebc 100644
--- a/lib/images.js
+++ b/lib/images.js
@@ -1,14 +1,16 @@
var promises = require("./promises");
-var htmlPaths = require("./html-paths");
+var Html = require("./html");
exports.inline = function(func) {
- return function(element, html, messages, callback) {
+ return function(element, messages, callback) {
return promises.when(func(element)).then(function(result) {
var attributes = {src: result.src};
if (element.altText) {
attributes.alt = element.altText;
}
- html.selfClosing(htmlPaths.element("img", attributes));
- }).then(callback, callback);
+ return Html.selfClosingElement("img", attributes);
+ }).then(function(value) {
+ callback(null, value);
+ }, callback);
};
};