From a84aa5097c5497799138dc0bdacd48dee4401ae2 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 7 Sep 2015 21:57:08 +0100 Subject: Override files.js for the browser --- browser/docx/files.js | 14 ++++++++++++++ package.json | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 browser/docx/files.js diff --git a/browser/docx/files.js b/browser/docx/files.js new file mode 100644 index 0000000..96736fa --- /dev/null +++ b/browser/docx/files.js @@ -0,0 +1,14 @@ +var promises = require("../../lib/promises"); + +exports.Files = Files; + + +function Files() { + function read(uri) { + return promises.reject(new Error("could not open external image: '" + uri + "'\ncannot open linked files from a web browser")); + } + + return { + read: read + }; +} diff --git a/package.json b/package.json index d3b6c4c..0a49b5a 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "jshint": "^2.5.2" }, "browser": { - "./lib/unzip.js": "./browser/unzip.js" + "./lib/unzip.js": "./browser/unzip.js", + "./lib/docx/files.js": "./browser/docx/files.js" }, "bin": { "mammoth": "bin/mammoth" -- cgit v1.2.3