MCPcopy Index your code
hub / github.com/TruthHun/BookStack / imgElement

Function imgElement

static/word2md/mammoth.browser.js:2321–2331  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

2319exports.imgElement = imgElement;
2320
2321function imgElement(func) {
2322 return function(element, messages) {
2323 return promises.when(func(element)).then(function(result) {
2324 var attributes = _.clone(result);
2325 if (element.altText) {
2326 attributes.alt = element.altText;
2327 }
2328 return [Html.freshElement("img", attributes)];
2329 });
2330 };
2331}
2332
2333// Undocumented, but retained for backwards-compatibility with 0.3.x
2334exports.inline = exports.imgElement;

Callers 1

mammoth.browser.jsFile · 0.70

Calls 1

funcFunction · 0.85

Tested by

no test coverage detected