diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-09-07 20:39:54 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-09-07 20:39:54 +0100 |
| commit | 2596c1c7122096874d00d7c5392d4ffb482e31b6 (patch) | |
| tree | 9eea4c367538cc5b7c0554e7f7d3299dc82d166d /lib/document-to-html.js | |
| parent | 20406f3b17d2bb188b78c22602b79684086798d1 (diff) | |
Continue with warning when failing to read image
Diffstat (limited to 'lib/document-to-html.js')
| -rw-r--r-- | lib/document-to-html.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 907d62c..8a7cec0 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -174,6 +174,17 @@ function DocumentConversion(options) { }; }); }); + + function recoveringConvertImage(convertImage) { + return function(image, html, messages, callback) { + convertImage(image, html, messages, function(error) { + if (error) { + messages.push(results.warning(error.message)); + } + callback(); + }); + }; + } function noteHtmlId(note) { return htmlId(note.noteType + "-" + note.noteId); @@ -315,7 +326,7 @@ function DocumentConversion(options) { } }); }, - "image": options.convertImage || defaultConvertImage, + "image": recoveringConvertImage(options.convertImage || defaultConvertImage), "table": convertTable, "tableRow": convertTableRow, "tableCell": convertTableCell, |
