diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-04-02 17:14:31 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-04-02 17:14:31 +0100 |
| commit | 6a4cc9231f219c0047272c56081f881eab800d74 (patch) | |
| tree | a9631dfa47eb3db6a7060255e8b3042f3255756f /lib/images.js | |
| parent | 3afd698984f9ec3fcb9b16e5d6c12ea4a23dfb53 (diff) | |
Rename images.inline to images.imgElement
Diffstat (limited to 'lib/images.js')
| -rw-r--r-- | lib/images.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/images.js b/lib/images.js index d7c2ebc..7529673 100644 --- a/lib/images.js +++ b/lib/images.js @@ -1,10 +1,12 @@ +var _ = require("underscore"); + var promises = require("./promises"); var Html = require("./html"); -exports.inline = function(func) { +exports.imgElement = function(func) { return function(element, messages, callback) { return promises.when(func(element)).then(function(result) { - var attributes = {src: result.src}; + var attributes = _.clone(result); if (element.altText) { attributes.alt = element.altText; } @@ -14,3 +16,6 @@ exports.inline = function(func) { }, callback); }; }; + +// Undocumented, but retained for backwards-compatibility with 0.3.x +exports.inline = exports.imgElement; |
