diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-09-07 21:57:08 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-09-07 21:57:08 +0100 |
| commit | a84aa5097c5497799138dc0bdacd48dee4401ae2 (patch) | |
| tree | 6207610ad75ec8b4f84d33c0fa9a845f13c2f1ec | |
| parent | e479598b2e31d4963a3501e2f383af82dada296f (diff) | |
Override files.js for the browser
| -rw-r--r-- | browser/docx/files.js | 14 | ||||
| -rw-r--r-- | package.json | 3 |
2 files changed, 16 insertions, 1 deletions
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" |
