From 7b7ce0d563ddc07172b0f241a5c3baf344f256e8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 13 Oct 2015 23:29:41 +0100 Subject: Collapse similar HTML elements --- lib/images.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/images.js') 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); }; }; -- cgit v1.2.3