@ryangarber/markitdown-ts 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/markitdown.1 +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import { DOMParser, Document, Element, Node } from "@xmldom/xmldom";
|
|
|
19
19
|
import readExcelFile from "read-excel-file/universal";
|
|
20
20
|
import { unzipSync } from "fflate";
|
|
21
21
|
// package.json
|
|
22
|
-
var version = "0.2.
|
|
22
|
+
var version = "0.2.1";
|
|
23
23
|
var bugs = { "url": "https://github.com/ryangarber/markitdown-ts/issues" };
|
|
24
24
|
var author = "Ryan Garber";
|
|
25
25
|
// src/utils/bytes.ts
|
|
@@ -286,7 +286,7 @@ var DocxConverter = class extends HtmlConverter {
|
|
|
286
286
|
async convert(source, options) {
|
|
287
287
|
if (options.extension !== "docx") return null;
|
|
288
288
|
let mammothInput = { arrayBuffer: toArrayBuffer(source) };
|
|
289
|
-
if (typeof process !== "undefined" && process.versions
|
|
289
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) mammothInput = { buffer: Buffer.from(source) };
|
|
290
290
|
const mammothOptions = Object.fromEntries(Object.entries(options.mammoth ?? {}).flatMap(([key, value]) => value !== void 0 ? [[key, value]] : []));
|
|
291
291
|
const html = await mammoth.convertToHtml(mammothInput, mammothOptions);
|
|
292
292
|
return this.convertHtml(html.value);
|
package/dist/index.cjs
CHANGED
|
@@ -303,7 +303,7 @@ var DocxConverter = class extends HtmlConverter {
|
|
|
303
303
|
async convert(source, options) {
|
|
304
304
|
if (options.extension !== "docx") return null;
|
|
305
305
|
let mammothInput = { arrayBuffer: toArrayBuffer(source) };
|
|
306
|
-
if (typeof process !== "undefined" && process.versions
|
|
306
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) mammothInput = { buffer: Buffer.from(source) };
|
|
307
307
|
const mammothOptions = Object.fromEntries(Object.entries(options.mammoth ?? {}).flatMap(([key, value]) => value !== void 0 ? [[key, value]] : []));
|
|
308
308
|
const html = await mammoth.default.convertToHtml(mammothInput, mammothOptions);
|
|
309
309
|
return this.convertHtml(html.value);
|