@kreuzberg/html-to-markdown-wasm 2.19.0-rc.1 → 2.19.1
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/README.md +56 -2
- package/package.json +66 -66
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -202
- package/dist/html_to_markdown_wasm.d.ts +0 -200
- package/dist/html_to_markdown_wasm.js +0 -116
- package/dist/html_to_markdown_wasm_bg.js +0 -1355
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/html_to_markdown_wasm_bg.wasm.d.ts +0 -55
- package/dist/package.json +0 -27
- package/dist-node/LICENSE +0 -21
- package/dist-node/README.md +0 -202
- package/dist-node/html_to_markdown_wasm.d.ts +0 -197
- package/dist-node/html_to_markdown_wasm.js +0 -1369
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/html_to_markdown_wasm_bg.wasm.d.ts +0 -55
- package/dist-node/package.json +0 -21
- package/dist-web/LICENSE +0 -21
- package/dist-web/README.md +0 -202
- package/dist-web/html_to_markdown_wasm.d.ts +0 -277
- package/dist-web/html_to_markdown_wasm.js +0 -1395
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/html_to_markdown_wasm_bg.wasm.d.ts +0 -55
- package/dist-web/package.json +0 -25
|
@@ -1,1369 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {import("./html_to_markdown_wasm").WasmConversionOptions} WasmConversionOptions
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
let imports = {};
|
|
7
|
-
imports['__wbindgen_placeholder__'] = module.exports;
|
|
8
|
-
|
|
9
|
-
function addHeapObject(obj) {
|
|
10
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
11
|
-
const idx = heap_next;
|
|
12
|
-
heap_next = heap[idx];
|
|
13
|
-
|
|
14
|
-
heap[idx] = obj;
|
|
15
|
-
return idx;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function _assertClass(instance, klass) {
|
|
19
|
-
if (!(instance instanceof klass)) {
|
|
20
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function debugString(val) {
|
|
25
|
-
// primitive types
|
|
26
|
-
const type = typeof val;
|
|
27
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
28
|
-
return `${val}`;
|
|
29
|
-
}
|
|
30
|
-
if (type == 'string') {
|
|
31
|
-
return `"${val}"`;
|
|
32
|
-
}
|
|
33
|
-
if (type == 'symbol') {
|
|
34
|
-
const description = val.description;
|
|
35
|
-
if (description == null) {
|
|
36
|
-
return 'Symbol';
|
|
37
|
-
} else {
|
|
38
|
-
return `Symbol(${description})`;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (type == 'function') {
|
|
42
|
-
const name = val.name;
|
|
43
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
44
|
-
return `Function(${name})`;
|
|
45
|
-
} else {
|
|
46
|
-
return 'Function';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// objects
|
|
50
|
-
if (Array.isArray(val)) {
|
|
51
|
-
const length = val.length;
|
|
52
|
-
let debug = '[';
|
|
53
|
-
if (length > 0) {
|
|
54
|
-
debug += debugString(val[0]);
|
|
55
|
-
}
|
|
56
|
-
for(let i = 1; i < length; i++) {
|
|
57
|
-
debug += ', ' + debugString(val[i]);
|
|
58
|
-
}
|
|
59
|
-
debug += ']';
|
|
60
|
-
return debug;
|
|
61
|
-
}
|
|
62
|
-
// Test for built-in
|
|
63
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
64
|
-
let className;
|
|
65
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
66
|
-
className = builtInMatches[1];
|
|
67
|
-
} else {
|
|
68
|
-
// Failed to match the standard '[object ClassName]'
|
|
69
|
-
return toString.call(val);
|
|
70
|
-
}
|
|
71
|
-
if (className == 'Object') {
|
|
72
|
-
// we're a user defined class or Object
|
|
73
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
74
|
-
// easier than looping through ownProperties of `val`.
|
|
75
|
-
try {
|
|
76
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
77
|
-
} catch (_) {
|
|
78
|
-
return 'Object';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// errors
|
|
82
|
-
if (val instanceof Error) {
|
|
83
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
84
|
-
}
|
|
85
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
86
|
-
return className;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function dropObject(idx) {
|
|
90
|
-
if (idx < 132) return;
|
|
91
|
-
heap[idx] = heap_next;
|
|
92
|
-
heap_next = idx;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
96
|
-
ptr = ptr >>> 0;
|
|
97
|
-
const mem = getDataViewMemory0();
|
|
98
|
-
const result = [];
|
|
99
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
100
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
101
|
-
}
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function getArrayU32FromWasm0(ptr, len) {
|
|
106
|
-
ptr = ptr >>> 0;
|
|
107
|
-
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
111
|
-
ptr = ptr >>> 0;
|
|
112
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
let cachedDataViewMemory0 = null;
|
|
116
|
-
function getDataViewMemory0() {
|
|
117
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
118
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
119
|
-
}
|
|
120
|
-
return cachedDataViewMemory0;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function getStringFromWasm0(ptr, len) {
|
|
124
|
-
ptr = ptr >>> 0;
|
|
125
|
-
return decodeText(ptr, len);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
let cachedUint32ArrayMemory0 = null;
|
|
129
|
-
function getUint32ArrayMemory0() {
|
|
130
|
-
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
131
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
132
|
-
}
|
|
133
|
-
return cachedUint32ArrayMemory0;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
let cachedUint8ArrayMemory0 = null;
|
|
137
|
-
function getUint8ArrayMemory0() {
|
|
138
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
139
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
140
|
-
}
|
|
141
|
-
return cachedUint8ArrayMemory0;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function getObject(idx) { return heap[idx]; }
|
|
145
|
-
|
|
146
|
-
function handleError(f, args) {
|
|
147
|
-
try {
|
|
148
|
-
return f.apply(this, args);
|
|
149
|
-
} catch (e) {
|
|
150
|
-
wasm.__wbindgen_export3(addHeapObject(e));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
let heap = new Array(128).fill(undefined);
|
|
155
|
-
heap.push(undefined, null, true, false);
|
|
156
|
-
|
|
157
|
-
let heap_next = heap.length;
|
|
158
|
-
|
|
159
|
-
function isLikeNone(x) {
|
|
160
|
-
return x === undefined || x === null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
164
|
-
if (realloc === undefined) {
|
|
165
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
166
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
167
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
168
|
-
WASM_VECTOR_LEN = buf.length;
|
|
169
|
-
return ptr;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
let len = arg.length;
|
|
173
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
174
|
-
|
|
175
|
-
const mem = getUint8ArrayMemory0();
|
|
176
|
-
|
|
177
|
-
let offset = 0;
|
|
178
|
-
|
|
179
|
-
for (; offset < len; offset++) {
|
|
180
|
-
const code = arg.charCodeAt(offset);
|
|
181
|
-
if (code > 0x7F) break;
|
|
182
|
-
mem[ptr + offset] = code;
|
|
183
|
-
}
|
|
184
|
-
if (offset !== len) {
|
|
185
|
-
if (offset !== 0) {
|
|
186
|
-
arg = arg.slice(offset);
|
|
187
|
-
}
|
|
188
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
189
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
190
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
191
|
-
|
|
192
|
-
offset += ret.written;
|
|
193
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
WASM_VECTOR_LEN = offset;
|
|
197
|
-
return ptr;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function takeObject(idx) {
|
|
201
|
-
const ret = getObject(idx);
|
|
202
|
-
dropObject(idx);
|
|
203
|
-
return ret;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
207
|
-
cachedTextDecoder.decode();
|
|
208
|
-
function decodeText(ptr, len) {
|
|
209
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const cachedTextEncoder = new TextEncoder();
|
|
213
|
-
|
|
214
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
215
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
216
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
217
|
-
view.set(buf);
|
|
218
|
-
return {
|
|
219
|
-
read: arg.length,
|
|
220
|
-
written: buf.length
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
let WASM_VECTOR_LEN = 0;
|
|
226
|
-
|
|
227
|
-
const WasmConversionOptionsHandleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
228
|
-
? { register: () => {}, unregister: () => {} }
|
|
229
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmconversionoptionshandle_free(ptr >>> 0, 1));
|
|
230
|
-
|
|
231
|
-
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
232
|
-
? { register: () => {}, unregister: () => {} }
|
|
233
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
234
|
-
|
|
235
|
-
const WasmInlineImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
236
|
-
? { register: () => {}, unregister: () => {} }
|
|
237
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimage_free(ptr >>> 0, 1));
|
|
238
|
-
|
|
239
|
-
const WasmInlineImageConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
240
|
-
? { register: () => {}, unregister: () => {} }
|
|
241
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimageconfig_free(ptr >>> 0, 1));
|
|
242
|
-
|
|
243
|
-
const WasmInlineImageWarningFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
244
|
-
? { register: () => {}, unregister: () => {} }
|
|
245
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimagewarning_free(ptr >>> 0, 1));
|
|
246
|
-
|
|
247
|
-
const WasmMetadataConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
248
|
-
? { register: () => {}, unregister: () => {} }
|
|
249
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmmetadataconfig_free(ptr >>> 0, 1));
|
|
250
|
-
|
|
251
|
-
class WasmConversionOptionsHandle {
|
|
252
|
-
static __wrap(ptr) {
|
|
253
|
-
ptr = ptr >>> 0;
|
|
254
|
-
const obj = Object.create(WasmConversionOptionsHandle.prototype);
|
|
255
|
-
obj.__wbg_ptr = ptr;
|
|
256
|
-
WasmConversionOptionsHandleFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
257
|
-
return obj;
|
|
258
|
-
}
|
|
259
|
-
__destroy_into_raw() {
|
|
260
|
-
const ptr = this.__wbg_ptr;
|
|
261
|
-
this.__wbg_ptr = 0;
|
|
262
|
-
WasmConversionOptionsHandleFinalization.unregister(this);
|
|
263
|
-
return ptr;
|
|
264
|
-
}
|
|
265
|
-
free() {
|
|
266
|
-
const ptr = this.__destroy_into_raw();
|
|
267
|
-
wasm.__wbg_wasmconversionoptionshandle_free(ptr, 0);
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
271
|
-
*/
|
|
272
|
-
constructor(options) {
|
|
273
|
-
try {
|
|
274
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
275
|
-
wasm.wasmconversionoptionshandle_new(retptr, addHeapObject(options));
|
|
276
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
277
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
278
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
279
|
-
if (r2) {
|
|
280
|
-
throw takeObject(r1);
|
|
281
|
-
}
|
|
282
|
-
this.__wbg_ptr = r0 >>> 0;
|
|
283
|
-
WasmConversionOptionsHandleFinalization.register(this, this.__wbg_ptr, this);
|
|
284
|
-
return this;
|
|
285
|
-
} finally {
|
|
286
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (Symbol.dispose) WasmConversionOptionsHandle.prototype[Symbol.dispose] = WasmConversionOptionsHandle.prototype.free;
|
|
291
|
-
exports.WasmConversionOptionsHandle = WasmConversionOptionsHandle;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Result of HTML extraction with inline images
|
|
295
|
-
*/
|
|
296
|
-
class WasmHtmlExtraction {
|
|
297
|
-
static __wrap(ptr) {
|
|
298
|
-
ptr = ptr >>> 0;
|
|
299
|
-
const obj = Object.create(WasmHtmlExtraction.prototype);
|
|
300
|
-
obj.__wbg_ptr = ptr;
|
|
301
|
-
WasmHtmlExtractionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
302
|
-
return obj;
|
|
303
|
-
}
|
|
304
|
-
__destroy_into_raw() {
|
|
305
|
-
const ptr = this.__wbg_ptr;
|
|
306
|
-
this.__wbg_ptr = 0;
|
|
307
|
-
WasmHtmlExtractionFinalization.unregister(this);
|
|
308
|
-
return ptr;
|
|
309
|
-
}
|
|
310
|
-
free() {
|
|
311
|
-
const ptr = this.__destroy_into_raw();
|
|
312
|
-
wasm.__wbg_wasmhtmlextraction_free(ptr, 0);
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* @returns {WasmInlineImage[]}
|
|
316
|
-
*/
|
|
317
|
-
get inlineImages() {
|
|
318
|
-
try {
|
|
319
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
320
|
-
wasm.wasmhtmlextraction_inlineImages(retptr, this.__wbg_ptr);
|
|
321
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
322
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
323
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
324
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
325
|
-
return v1;
|
|
326
|
-
} finally {
|
|
327
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* @returns {string}
|
|
332
|
-
*/
|
|
333
|
-
get markdown() {
|
|
334
|
-
let deferred1_0;
|
|
335
|
-
let deferred1_1;
|
|
336
|
-
try {
|
|
337
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
338
|
-
wasm.wasmhtmlextraction_markdown(retptr, this.__wbg_ptr);
|
|
339
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
340
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
341
|
-
deferred1_0 = r0;
|
|
342
|
-
deferred1_1 = r1;
|
|
343
|
-
return getStringFromWasm0(r0, r1);
|
|
344
|
-
} finally {
|
|
345
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
346
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* @returns {WasmInlineImageWarning[]}
|
|
351
|
-
*/
|
|
352
|
-
get warnings() {
|
|
353
|
-
try {
|
|
354
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
|
-
wasm.wasmhtmlextraction_warnings(retptr, this.__wbg_ptr);
|
|
356
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
357
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
358
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
359
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
360
|
-
return v1;
|
|
361
|
-
} finally {
|
|
362
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (Symbol.dispose) WasmHtmlExtraction.prototype[Symbol.dispose] = WasmHtmlExtraction.prototype.free;
|
|
367
|
-
exports.WasmHtmlExtraction = WasmHtmlExtraction;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Inline image data
|
|
371
|
-
*/
|
|
372
|
-
class WasmInlineImage {
|
|
373
|
-
static __wrap(ptr) {
|
|
374
|
-
ptr = ptr >>> 0;
|
|
375
|
-
const obj = Object.create(WasmInlineImage.prototype);
|
|
376
|
-
obj.__wbg_ptr = ptr;
|
|
377
|
-
WasmInlineImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
378
|
-
return obj;
|
|
379
|
-
}
|
|
380
|
-
__destroy_into_raw() {
|
|
381
|
-
const ptr = this.__wbg_ptr;
|
|
382
|
-
this.__wbg_ptr = 0;
|
|
383
|
-
WasmInlineImageFinalization.unregister(this);
|
|
384
|
-
return ptr;
|
|
385
|
-
}
|
|
386
|
-
free() {
|
|
387
|
-
const ptr = this.__destroy_into_raw();
|
|
388
|
-
wasm.__wbg_wasminlineimage_free(ptr, 0);
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* @returns {Record<string, string>}
|
|
392
|
-
*/
|
|
393
|
-
get attributes() {
|
|
394
|
-
const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
|
|
395
|
-
return takeObject(ret);
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* @returns {Uint32Array | undefined}
|
|
399
|
-
*/
|
|
400
|
-
get dimensions() {
|
|
401
|
-
try {
|
|
402
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
403
|
-
wasm.wasminlineimage_dimensions(retptr, this.__wbg_ptr);
|
|
404
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
405
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
406
|
-
let v1;
|
|
407
|
-
if (r0 !== 0) {
|
|
408
|
-
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
409
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
410
|
-
}
|
|
411
|
-
return v1;
|
|
412
|
-
} finally {
|
|
413
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* @returns {string | undefined}
|
|
418
|
-
*/
|
|
419
|
-
get description() {
|
|
420
|
-
try {
|
|
421
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
422
|
-
wasm.wasminlineimage_description(retptr, this.__wbg_ptr);
|
|
423
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
424
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
425
|
-
let v1;
|
|
426
|
-
if (r0 !== 0) {
|
|
427
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
428
|
-
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
429
|
-
}
|
|
430
|
-
return v1;
|
|
431
|
-
} finally {
|
|
432
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* @returns {Uint8Array}
|
|
437
|
-
*/
|
|
438
|
-
get data() {
|
|
439
|
-
const ret = wasm.wasminlineimage_data(this.__wbg_ptr);
|
|
440
|
-
return takeObject(ret);
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* @returns {string}
|
|
444
|
-
*/
|
|
445
|
-
get format() {
|
|
446
|
-
let deferred1_0;
|
|
447
|
-
let deferred1_1;
|
|
448
|
-
try {
|
|
449
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
450
|
-
wasm.wasminlineimage_format(retptr, this.__wbg_ptr);
|
|
451
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
452
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
453
|
-
deferred1_0 = r0;
|
|
454
|
-
deferred1_1 = r1;
|
|
455
|
-
return getStringFromWasm0(r0, r1);
|
|
456
|
-
} finally {
|
|
457
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
458
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* @returns {string}
|
|
463
|
-
*/
|
|
464
|
-
get source() {
|
|
465
|
-
let deferred1_0;
|
|
466
|
-
let deferred1_1;
|
|
467
|
-
try {
|
|
468
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
469
|
-
wasm.wasminlineimage_source(retptr, this.__wbg_ptr);
|
|
470
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
471
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
472
|
-
deferred1_0 = r0;
|
|
473
|
-
deferred1_1 = r1;
|
|
474
|
-
return getStringFromWasm0(r0, r1);
|
|
475
|
-
} finally {
|
|
476
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
477
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* @returns {string | undefined}
|
|
482
|
-
*/
|
|
483
|
-
get filename() {
|
|
484
|
-
try {
|
|
485
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
486
|
-
wasm.wasminlineimage_filename(retptr, this.__wbg_ptr);
|
|
487
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
488
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
489
|
-
let v1;
|
|
490
|
-
if (r0 !== 0) {
|
|
491
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
492
|
-
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
493
|
-
}
|
|
494
|
-
return v1;
|
|
495
|
-
} finally {
|
|
496
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
if (Symbol.dispose) WasmInlineImage.prototype[Symbol.dispose] = WasmInlineImage.prototype.free;
|
|
501
|
-
exports.WasmInlineImage = WasmInlineImage;
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Inline image configuration
|
|
505
|
-
*/
|
|
506
|
-
class WasmInlineImageConfig {
|
|
507
|
-
__destroy_into_raw() {
|
|
508
|
-
const ptr = this.__wbg_ptr;
|
|
509
|
-
this.__wbg_ptr = 0;
|
|
510
|
-
WasmInlineImageConfigFinalization.unregister(this);
|
|
511
|
-
return ptr;
|
|
512
|
-
}
|
|
513
|
-
free() {
|
|
514
|
-
const ptr = this.__destroy_into_raw();
|
|
515
|
-
wasm.__wbg_wasminlineimageconfig_free(ptr, 0);
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* @param {boolean} capture
|
|
519
|
-
*/
|
|
520
|
-
set captureSvg(capture) {
|
|
521
|
-
wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
|
|
522
|
-
}
|
|
523
|
-
/**
|
|
524
|
-
* @param {string | null} [prefix]
|
|
525
|
-
*/
|
|
526
|
-
set filenamePrefix(prefix) {
|
|
527
|
-
var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
528
|
-
var len0 = WASM_VECTOR_LEN;
|
|
529
|
-
wasm.wasminlineimageconfig_set_filenamePrefix(this.__wbg_ptr, ptr0, len0);
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* @param {boolean} infer
|
|
533
|
-
*/
|
|
534
|
-
set inferDimensions(infer) {
|
|
535
|
-
wasm.wasminlineimageconfig_set_inferDimensions(this.__wbg_ptr, infer);
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* @param {number | null} [max_decoded_size_bytes]
|
|
539
|
-
*/
|
|
540
|
-
constructor(max_decoded_size_bytes) {
|
|
541
|
-
const ret = wasm.wasminlineimageconfig_new(!isLikeNone(max_decoded_size_bytes), isLikeNone(max_decoded_size_bytes) ? 0 : max_decoded_size_bytes);
|
|
542
|
-
this.__wbg_ptr = ret >>> 0;
|
|
543
|
-
WasmInlineImageConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
544
|
-
return this;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
if (Symbol.dispose) WasmInlineImageConfig.prototype[Symbol.dispose] = WasmInlineImageConfig.prototype.free;
|
|
548
|
-
exports.WasmInlineImageConfig = WasmInlineImageConfig;
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Warning about inline image processing
|
|
552
|
-
*/
|
|
553
|
-
class WasmInlineImageWarning {
|
|
554
|
-
static __wrap(ptr) {
|
|
555
|
-
ptr = ptr >>> 0;
|
|
556
|
-
const obj = Object.create(WasmInlineImageWarning.prototype);
|
|
557
|
-
obj.__wbg_ptr = ptr;
|
|
558
|
-
WasmInlineImageWarningFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
559
|
-
return obj;
|
|
560
|
-
}
|
|
561
|
-
__destroy_into_raw() {
|
|
562
|
-
const ptr = this.__wbg_ptr;
|
|
563
|
-
this.__wbg_ptr = 0;
|
|
564
|
-
WasmInlineImageWarningFinalization.unregister(this);
|
|
565
|
-
return ptr;
|
|
566
|
-
}
|
|
567
|
-
free() {
|
|
568
|
-
const ptr = this.__destroy_into_raw();
|
|
569
|
-
wasm.__wbg_wasminlineimagewarning_free(ptr, 0);
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* @returns {number}
|
|
573
|
-
*/
|
|
574
|
-
get index() {
|
|
575
|
-
const ret = wasm.wasminlineimagewarning_index(this.__wbg_ptr);
|
|
576
|
-
return ret >>> 0;
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* @returns {string}
|
|
580
|
-
*/
|
|
581
|
-
get message() {
|
|
582
|
-
let deferred1_0;
|
|
583
|
-
let deferred1_1;
|
|
584
|
-
try {
|
|
585
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
586
|
-
wasm.wasminlineimagewarning_message(retptr, this.__wbg_ptr);
|
|
587
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
588
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
589
|
-
deferred1_0 = r0;
|
|
590
|
-
deferred1_1 = r1;
|
|
591
|
-
return getStringFromWasm0(r0, r1);
|
|
592
|
-
} finally {
|
|
593
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
594
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
if (Symbol.dispose) WasmInlineImageWarning.prototype[Symbol.dispose] = WasmInlineImageWarning.prototype.free;
|
|
599
|
-
exports.WasmInlineImageWarning = WasmInlineImageWarning;
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Metadata extraction configuration
|
|
603
|
-
*/
|
|
604
|
-
class WasmMetadataConfig {
|
|
605
|
-
__destroy_into_raw() {
|
|
606
|
-
const ptr = this.__wbg_ptr;
|
|
607
|
-
this.__wbg_ptr = 0;
|
|
608
|
-
WasmMetadataConfigFinalization.unregister(this);
|
|
609
|
-
return ptr;
|
|
610
|
-
}
|
|
611
|
-
free() {
|
|
612
|
-
const ptr = this.__destroy_into_raw();
|
|
613
|
-
wasm.__wbg_wasmmetadataconfig_free(ptr, 0);
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* @returns {boolean}
|
|
617
|
-
*/
|
|
618
|
-
get extract_links() {
|
|
619
|
-
const ret = wasm.wasmmetadataconfig_extract_links(this.__wbg_ptr);
|
|
620
|
-
return ret !== 0;
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* @returns {boolean}
|
|
624
|
-
*/
|
|
625
|
-
get extract_images() {
|
|
626
|
-
const ret = wasm.wasmmetadataconfig_extract_images(this.__wbg_ptr);
|
|
627
|
-
return ret !== 0;
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* @returns {boolean}
|
|
631
|
-
*/
|
|
632
|
-
get extract_headers() {
|
|
633
|
-
const ret = wasm.wasmmetadataconfig_extract_headers(this.__wbg_ptr);
|
|
634
|
-
return ret !== 0;
|
|
635
|
-
}
|
|
636
|
-
/**
|
|
637
|
-
* @returns {boolean}
|
|
638
|
-
*/
|
|
639
|
-
get extract_document() {
|
|
640
|
-
const ret = wasm.wasmmetadataconfig_extract_document(this.__wbg_ptr);
|
|
641
|
-
return ret !== 0;
|
|
642
|
-
}
|
|
643
|
-
/**
|
|
644
|
-
* @param {boolean} value
|
|
645
|
-
*/
|
|
646
|
-
set extract_links(value) {
|
|
647
|
-
wasm.wasmmetadataconfig_set_extract_links(this.__wbg_ptr, value);
|
|
648
|
-
}
|
|
649
|
-
/**
|
|
650
|
-
* @param {boolean} value
|
|
651
|
-
*/
|
|
652
|
-
set extract_images(value) {
|
|
653
|
-
wasm.wasmmetadataconfig_set_extract_images(this.__wbg_ptr, value);
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* @param {boolean} value
|
|
657
|
-
*/
|
|
658
|
-
set extract_headers(value) {
|
|
659
|
-
wasm.wasmmetadataconfig_set_extract_headers(this.__wbg_ptr, value);
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* @param {boolean} value
|
|
663
|
-
*/
|
|
664
|
-
set extract_document(value) {
|
|
665
|
-
wasm.wasmmetadataconfig_set_extract_document(this.__wbg_ptr, value);
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* @returns {boolean}
|
|
669
|
-
*/
|
|
670
|
-
get extract_structured_data() {
|
|
671
|
-
const ret = wasm.wasmmetadataconfig_extract_structured_data(this.__wbg_ptr);
|
|
672
|
-
return ret !== 0;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
* @returns {number}
|
|
676
|
-
*/
|
|
677
|
-
get max_structured_data_size() {
|
|
678
|
-
const ret = wasm.wasmmetadataconfig_max_structured_data_size(this.__wbg_ptr);
|
|
679
|
-
return ret >>> 0;
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* @param {boolean} value
|
|
683
|
-
*/
|
|
684
|
-
set extract_structured_data(value) {
|
|
685
|
-
wasm.wasmmetadataconfig_set_extract_structured_data(this.__wbg_ptr, value);
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* @param {number} value
|
|
689
|
-
*/
|
|
690
|
-
set max_structured_data_size(value) {
|
|
691
|
-
wasm.wasmmetadataconfig_set_max_structured_data_size(this.__wbg_ptr, value);
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* Create a new metadata configuration with defaults
|
|
695
|
-
*
|
|
696
|
-
* All extraction types enabled by default with 1MB structured data limit
|
|
697
|
-
*/
|
|
698
|
-
constructor() {
|
|
699
|
-
const ret = wasm.wasmmetadataconfig_new();
|
|
700
|
-
this.__wbg_ptr = ret >>> 0;
|
|
701
|
-
WasmMetadataConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
702
|
-
return this;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
if (Symbol.dispose) WasmMetadataConfig.prototype[Symbol.dispose] = WasmMetadataConfig.prototype.free;
|
|
706
|
-
exports.WasmMetadataConfig = WasmMetadataConfig;
|
|
707
|
-
|
|
708
|
-
/**
|
|
709
|
-
* Convert HTML to Markdown
|
|
710
|
-
*
|
|
711
|
-
* # Arguments
|
|
712
|
-
*
|
|
713
|
-
* * `html` - The HTML string to convert
|
|
714
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
715
|
-
*
|
|
716
|
-
* # Example
|
|
717
|
-
*
|
|
718
|
-
* ```javascript
|
|
719
|
-
* import { convert } from 'html-to-markdown-wasm';
|
|
720
|
-
*
|
|
721
|
-
* const html = '<h1>Hello World</h1>';
|
|
722
|
-
* const markdown = convert(html);
|
|
723
|
-
* console.log(markdown); // # Hello World
|
|
724
|
-
* ```
|
|
725
|
-
* @param {string} html
|
|
726
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
727
|
-
* @returns {string}
|
|
728
|
-
*/
|
|
729
|
-
function convert(html, options) {
|
|
730
|
-
let deferred3_0;
|
|
731
|
-
let deferred3_1;
|
|
732
|
-
try {
|
|
733
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
734
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
735
|
-
const len0 = WASM_VECTOR_LEN;
|
|
736
|
-
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
737
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
738
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
739
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
740
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
741
|
-
var ptr2 = r0;
|
|
742
|
-
var len2 = r1;
|
|
743
|
-
if (r3) {
|
|
744
|
-
ptr2 = 0; len2 = 0;
|
|
745
|
-
throw takeObject(r2);
|
|
746
|
-
}
|
|
747
|
-
deferred3_0 = ptr2;
|
|
748
|
-
deferred3_1 = len2;
|
|
749
|
-
return getStringFromWasm0(ptr2, len2);
|
|
750
|
-
} finally {
|
|
751
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
752
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
exports.convert = convert;
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
* @param {Uint8Array} html
|
|
759
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
760
|
-
* @returns {string}
|
|
761
|
-
*/
|
|
762
|
-
function convertBytes(html, options) {
|
|
763
|
-
let deferred2_0;
|
|
764
|
-
let deferred2_1;
|
|
765
|
-
try {
|
|
766
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
767
|
-
wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
|
|
768
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
769
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
770
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
771
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
772
|
-
var ptr1 = r0;
|
|
773
|
-
var len1 = r1;
|
|
774
|
-
if (r3) {
|
|
775
|
-
ptr1 = 0; len1 = 0;
|
|
776
|
-
throw takeObject(r2);
|
|
777
|
-
}
|
|
778
|
-
deferred2_0 = ptr1;
|
|
779
|
-
deferred2_1 = len1;
|
|
780
|
-
return getStringFromWasm0(ptr1, len1);
|
|
781
|
-
} finally {
|
|
782
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
783
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
exports.convertBytes = convertBytes;
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* @param {Uint8Array} html
|
|
790
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
791
|
-
* @param {WasmInlineImageConfig | null} [image_config]
|
|
792
|
-
* @returns {WasmHtmlExtraction}
|
|
793
|
-
*/
|
|
794
|
-
function convertBytesWithInlineImages(html, options, image_config) {
|
|
795
|
-
try {
|
|
796
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
797
|
-
let ptr0 = 0;
|
|
798
|
-
if (!isLikeNone(image_config)) {
|
|
799
|
-
_assertClass(image_config, WasmInlineImageConfig);
|
|
800
|
-
ptr0 = image_config.__destroy_into_raw();
|
|
801
|
-
}
|
|
802
|
-
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
803
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
804
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
805
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
806
|
-
if (r2) {
|
|
807
|
-
throw takeObject(r1);
|
|
808
|
-
}
|
|
809
|
-
return WasmHtmlExtraction.__wrap(r0);
|
|
810
|
-
} finally {
|
|
811
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
exports.convertBytesWithInlineImages = convertBytesWithInlineImages;
|
|
815
|
-
|
|
816
|
-
/**
|
|
817
|
-
* Convert HTML bytes to Markdown with metadata extraction
|
|
818
|
-
*
|
|
819
|
-
* # Arguments
|
|
820
|
-
*
|
|
821
|
-
* * `html` - The HTML bytes to convert
|
|
822
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
823
|
-
* * `metadata_config` - Metadata extraction configuration
|
|
824
|
-
*
|
|
825
|
-
* # Returns
|
|
826
|
-
*
|
|
827
|
-
* JavaScript object with `markdown` (string) and `metadata` (object) fields
|
|
828
|
-
* @param {Uint8Array} html
|
|
829
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
830
|
-
* @param {WasmMetadataConfig | null} [metadata_config]
|
|
831
|
-
* @returns {Record<string, string>}
|
|
832
|
-
*/
|
|
833
|
-
function convertBytesWithMetadata(html, options, metadata_config) {
|
|
834
|
-
try {
|
|
835
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
836
|
-
let ptr0 = 0;
|
|
837
|
-
if (!isLikeNone(metadata_config)) {
|
|
838
|
-
_assertClass(metadata_config, WasmMetadataConfig);
|
|
839
|
-
ptr0 = metadata_config.__destroy_into_raw();
|
|
840
|
-
}
|
|
841
|
-
wasm.convertBytesWithMetadata(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
842
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
843
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
844
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
845
|
-
if (r2) {
|
|
846
|
-
throw takeObject(r1);
|
|
847
|
-
}
|
|
848
|
-
return takeObject(r0);
|
|
849
|
-
} finally {
|
|
850
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
exports.convertBytesWithMetadata = convertBytesWithMetadata;
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* @param {Uint8Array} html
|
|
857
|
-
* @param {WasmConversionOptionsHandle} handle
|
|
858
|
-
* @returns {string}
|
|
859
|
-
*/
|
|
860
|
-
function convertBytesWithOptionsHandle(html, handle) {
|
|
861
|
-
let deferred2_0;
|
|
862
|
-
let deferred2_1;
|
|
863
|
-
try {
|
|
864
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
865
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
866
|
-
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
867
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
868
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
869
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
870
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
871
|
-
var ptr1 = r0;
|
|
872
|
-
var len1 = r1;
|
|
873
|
-
if (r3) {
|
|
874
|
-
ptr1 = 0; len1 = 0;
|
|
875
|
-
throw takeObject(r2);
|
|
876
|
-
}
|
|
877
|
-
deferred2_0 = ptr1;
|
|
878
|
-
deferred2_1 = len1;
|
|
879
|
-
return getStringFromWasm0(ptr1, len1);
|
|
880
|
-
} finally {
|
|
881
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
882
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
exports.convertBytesWithOptionsHandle = convertBytesWithOptionsHandle;
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* @param {string} html
|
|
889
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
890
|
-
* @param {WasmInlineImageConfig | null} [image_config]
|
|
891
|
-
* @returns {WasmHtmlExtraction}
|
|
892
|
-
*/
|
|
893
|
-
function convertWithInlineImages(html, options, image_config) {
|
|
894
|
-
try {
|
|
895
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
896
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
897
|
-
const len0 = WASM_VECTOR_LEN;
|
|
898
|
-
let ptr1 = 0;
|
|
899
|
-
if (!isLikeNone(image_config)) {
|
|
900
|
-
_assertClass(image_config, WasmInlineImageConfig);
|
|
901
|
-
ptr1 = image_config.__destroy_into_raw();
|
|
902
|
-
}
|
|
903
|
-
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
904
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
905
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
906
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
907
|
-
if (r2) {
|
|
908
|
-
throw takeObject(r1);
|
|
909
|
-
}
|
|
910
|
-
return WasmHtmlExtraction.__wrap(r0);
|
|
911
|
-
} finally {
|
|
912
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
exports.convertWithInlineImages = convertWithInlineImages;
|
|
916
|
-
|
|
917
|
-
/**
|
|
918
|
-
* Convert HTML to Markdown with metadata extraction
|
|
919
|
-
*
|
|
920
|
-
* # Arguments
|
|
921
|
-
*
|
|
922
|
-
* * `html` - The HTML string to convert
|
|
923
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
924
|
-
* * `metadata_config` - Metadata extraction configuration
|
|
925
|
-
*
|
|
926
|
-
* # Returns
|
|
927
|
-
*
|
|
928
|
-
* JavaScript object with `markdown` (string) and `metadata` (object) fields
|
|
929
|
-
*
|
|
930
|
-
* # Example
|
|
931
|
-
*
|
|
932
|
-
* ```javascript
|
|
933
|
-
* import { convertWithMetadata, WasmMetadataConfig } from 'html-to-markdown-wasm';
|
|
934
|
-
*
|
|
935
|
-
* const html = '<h1>Hello World</h1><a href="https://example.com">Link</a>';
|
|
936
|
-
* const config = new WasmMetadataConfig();
|
|
937
|
-
* config.extractHeaders = true;
|
|
938
|
-
* config.extractLinks = true;
|
|
939
|
-
*
|
|
940
|
-
* const result = convertWithMetadata(html, null, config);
|
|
941
|
-
* console.log(result.markdown); // # Hello World\n\n[Link](https://example.com)
|
|
942
|
-
* console.log(result.metadata.headers); // [{ level: 1, text: "Hello World", ... }]
|
|
943
|
-
* console.log(result.metadata.links); // [{ href: "https://example.com", text: "Link", ... }]
|
|
944
|
-
* ```
|
|
945
|
-
* @param {string} html
|
|
946
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
947
|
-
* @param {WasmMetadataConfig | null} [metadata_config]
|
|
948
|
-
* @returns {Record<string, string>}
|
|
949
|
-
*/
|
|
950
|
-
function convertWithMetadata(html, options, metadata_config) {
|
|
951
|
-
try {
|
|
952
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
953
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
954
|
-
const len0 = WASM_VECTOR_LEN;
|
|
955
|
-
let ptr1 = 0;
|
|
956
|
-
if (!isLikeNone(metadata_config)) {
|
|
957
|
-
_assertClass(metadata_config, WasmMetadataConfig);
|
|
958
|
-
ptr1 = metadata_config.__destroy_into_raw();
|
|
959
|
-
}
|
|
960
|
-
wasm.convertWithMetadata(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
961
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
962
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
963
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
964
|
-
if (r2) {
|
|
965
|
-
throw takeObject(r1);
|
|
966
|
-
}
|
|
967
|
-
return takeObject(r0);
|
|
968
|
-
} finally {
|
|
969
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
exports.convertWithMetadata = convertWithMetadata;
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
* @param {string} html
|
|
976
|
-
* @param {WasmConversionOptionsHandle} handle
|
|
977
|
-
* @returns {string}
|
|
978
|
-
*/
|
|
979
|
-
function convertWithOptionsHandle(html, handle) {
|
|
980
|
-
let deferred3_0;
|
|
981
|
-
let deferred3_1;
|
|
982
|
-
try {
|
|
983
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
984
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
985
|
-
const len0 = WASM_VECTOR_LEN;
|
|
986
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
987
|
-
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
988
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
989
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
990
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
991
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
992
|
-
var ptr2 = r0;
|
|
993
|
-
var len2 = r1;
|
|
994
|
-
if (r3) {
|
|
995
|
-
ptr2 = 0; len2 = 0;
|
|
996
|
-
throw takeObject(r2);
|
|
997
|
-
}
|
|
998
|
-
deferred3_0 = ptr2;
|
|
999
|
-
deferred3_1 = len2;
|
|
1000
|
-
return getStringFromWasm0(ptr2, len2);
|
|
1001
|
-
} finally {
|
|
1002
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1003
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
exports.convertWithOptionsHandle = convertWithOptionsHandle;
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* @param {WasmConversionOptions | null | undefined} [options]
|
|
1010
|
-
* @returns {WasmConversionOptionsHandle}
|
|
1011
|
-
*/
|
|
1012
|
-
function createConversionOptionsHandle(options) {
|
|
1013
|
-
try {
|
|
1014
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1015
|
-
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
1016
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1017
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1018
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1019
|
-
if (r2) {
|
|
1020
|
-
throw takeObject(r1);
|
|
1021
|
-
}
|
|
1022
|
-
return WasmConversionOptionsHandle.__wrap(r0);
|
|
1023
|
-
} finally {
|
|
1024
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
exports.createConversionOptionsHandle = createConversionOptionsHandle;
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
* Initialize panic hook for better error messages in the browser
|
|
1031
|
-
*/
|
|
1032
|
-
function init() {
|
|
1033
|
-
wasm.init();
|
|
1034
|
-
}
|
|
1035
|
-
exports.init = init;
|
|
1036
|
-
|
|
1037
|
-
exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
1038
|
-
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1039
|
-
return addHeapObject(ret);
|
|
1040
|
-
};
|
|
1041
|
-
|
|
1042
|
-
exports.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
1043
|
-
const ret = Number(getObject(arg0));
|
|
1044
|
-
return ret;
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
1048
|
-
const ret = String(getObject(arg1));
|
|
1049
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1050
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1051
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1052
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1053
|
-
};
|
|
1054
|
-
|
|
1055
|
-
exports.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
|
|
1056
|
-
const v = getObject(arg1);
|
|
1057
|
-
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
1058
|
-
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
1059
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
|
-
exports.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
1063
|
-
const v = getObject(arg0);
|
|
1064
|
-
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
1065
|
-
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
|
-
exports.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
1069
|
-
const ret = debugString(getObject(arg1));
|
|
1070
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1071
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1072
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1073
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
exports.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
1077
|
-
const ret = getObject(arg0) in getObject(arg1);
|
|
1078
|
-
return ret;
|
|
1079
|
-
};
|
|
1080
|
-
|
|
1081
|
-
exports.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
|
|
1082
|
-
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
1083
|
-
return ret;
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
exports.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
|
|
1087
|
-
const ret = typeof(getObject(arg0)) === 'function';
|
|
1088
|
-
return ret;
|
|
1089
|
-
};
|
|
1090
|
-
|
|
1091
|
-
exports.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
|
|
1092
|
-
const ret = getObject(arg0) === null;
|
|
1093
|
-
return ret;
|
|
1094
|
-
};
|
|
1095
|
-
|
|
1096
|
-
exports.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
1097
|
-
const val = getObject(arg0);
|
|
1098
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
1099
|
-
return ret;
|
|
1100
|
-
};
|
|
1101
|
-
|
|
1102
|
-
exports.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
1103
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
1104
|
-
return ret;
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
|
-
exports.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
1108
|
-
const ret = getObject(arg0) === undefined;
|
|
1109
|
-
return ret;
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
exports.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
|
|
1113
|
-
const ret = getObject(arg0) === getObject(arg1);
|
|
1114
|
-
return ret;
|
|
1115
|
-
};
|
|
1116
|
-
|
|
1117
|
-
exports.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
1118
|
-
const ret = getObject(arg0) == getObject(arg1);
|
|
1119
|
-
return ret;
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
1123
|
-
const obj = getObject(arg1);
|
|
1124
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1125
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1126
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1127
|
-
};
|
|
1128
|
-
|
|
1129
|
-
exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
1130
|
-
const obj = getObject(arg1);
|
|
1131
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1132
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1133
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1134
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1135
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1136
|
-
};
|
|
1137
|
-
|
|
1138
|
-
exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
1139
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1140
|
-
};
|
|
1141
|
-
|
|
1142
|
-
exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
|
|
1143
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
1144
|
-
return addHeapObject(ret);
|
|
1145
|
-
}, arguments) };
|
|
1146
|
-
|
|
1147
|
-
exports.__wbg_codePointAt_6fd4439a1e465afd = function(arg0, arg1) {
|
|
1148
|
-
const ret = getObject(arg0).codePointAt(arg1 >>> 0);
|
|
1149
|
-
return addHeapObject(ret);
|
|
1150
|
-
};
|
|
1151
|
-
|
|
1152
|
-
exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
1153
|
-
const ret = getObject(arg0).done;
|
|
1154
|
-
return ret;
|
|
1155
|
-
};
|
|
1156
|
-
|
|
1157
|
-
exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
1158
|
-
let deferred0_0;
|
|
1159
|
-
let deferred0_1;
|
|
1160
|
-
try {
|
|
1161
|
-
deferred0_0 = arg0;
|
|
1162
|
-
deferred0_1 = arg1;
|
|
1163
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
1164
|
-
} finally {
|
|
1165
|
-
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
1166
|
-
}
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
1170
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1171
|
-
return addHeapObject(ret);
|
|
1172
|
-
};
|
|
1173
|
-
|
|
1174
|
-
exports.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
1175
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1176
|
-
return addHeapObject(ret);
|
|
1177
|
-
}, arguments) };
|
|
1178
|
-
|
|
1179
|
-
exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
1180
|
-
const ret = getObject(arg0)[getObject(arg1)];
|
|
1181
|
-
return addHeapObject(ret);
|
|
1182
|
-
};
|
|
1183
|
-
|
|
1184
|
-
exports.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
1185
|
-
let result;
|
|
1186
|
-
try {
|
|
1187
|
-
result = getObject(arg0) instanceof ArrayBuffer;
|
|
1188
|
-
} catch (_) {
|
|
1189
|
-
result = false;
|
|
1190
|
-
}
|
|
1191
|
-
const ret = result;
|
|
1192
|
-
return ret;
|
|
1193
|
-
};
|
|
1194
|
-
|
|
1195
|
-
exports.__wbg_instanceof_Object_577e21051f7bcb79 = function(arg0) {
|
|
1196
|
-
let result;
|
|
1197
|
-
try {
|
|
1198
|
-
result = getObject(arg0) instanceof Object;
|
|
1199
|
-
} catch (_) {
|
|
1200
|
-
result = false;
|
|
1201
|
-
}
|
|
1202
|
-
const ret = result;
|
|
1203
|
-
return ret;
|
|
1204
|
-
};
|
|
1205
|
-
|
|
1206
|
-
exports.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
1207
|
-
let result;
|
|
1208
|
-
try {
|
|
1209
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
1210
|
-
} catch (_) {
|
|
1211
|
-
result = false;
|
|
1212
|
-
}
|
|
1213
|
-
const ret = result;
|
|
1214
|
-
return ret;
|
|
1215
|
-
};
|
|
1216
|
-
|
|
1217
|
-
exports.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
|
|
1218
|
-
const ret = Array.isArray(getObject(arg0));
|
|
1219
|
-
return ret;
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
|
-
exports.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
|
|
1223
|
-
const ret = Number.isSafeInteger(getObject(arg0));
|
|
1224
|
-
return ret;
|
|
1225
|
-
};
|
|
1226
|
-
|
|
1227
|
-
exports.__wbg_iterator_27b7c8b35ab3e86b = function() {
|
|
1228
|
-
const ret = Symbol.iterator;
|
|
1229
|
-
return addHeapObject(ret);
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
exports.__wbg_keys_f5c6002ff150fc6c = function(arg0) {
|
|
1233
|
-
const ret = Object.keys(getObject(arg0));
|
|
1234
|
-
return addHeapObject(ret);
|
|
1235
|
-
};
|
|
1236
|
-
|
|
1237
|
-
exports.__wbg_length_1f83b8e5895c84aa = function(arg0) {
|
|
1238
|
-
const ret = getObject(arg0).length;
|
|
1239
|
-
return ret;
|
|
1240
|
-
};
|
|
1241
|
-
|
|
1242
|
-
exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
1243
|
-
const ret = getObject(arg0).length;
|
|
1244
|
-
return ret;
|
|
1245
|
-
};
|
|
1246
|
-
|
|
1247
|
-
exports.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
1248
|
-
const ret = getObject(arg0).length;
|
|
1249
|
-
return ret;
|
|
1250
|
-
};
|
|
1251
|
-
|
|
1252
|
-
exports.__wbg_new_1ba21ce319a06297 = function() {
|
|
1253
|
-
const ret = new Object();
|
|
1254
|
-
return addHeapObject(ret);
|
|
1255
|
-
};
|
|
1256
|
-
|
|
1257
|
-
exports.__wbg_new_25f239778d6112b9 = function() {
|
|
1258
|
-
const ret = new Array();
|
|
1259
|
-
return addHeapObject(ret);
|
|
1260
|
-
};
|
|
1261
|
-
|
|
1262
|
-
exports.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
1263
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
1264
|
-
return addHeapObject(ret);
|
|
1265
|
-
};
|
|
1266
|
-
|
|
1267
|
-
exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
1268
|
-
const ret = new Error();
|
|
1269
|
-
return addHeapObject(ret);
|
|
1270
|
-
};
|
|
1271
|
-
|
|
1272
|
-
exports.__wbg_new_b546ae120718850e = function() {
|
|
1273
|
-
const ret = new Map();
|
|
1274
|
-
return addHeapObject(ret);
|
|
1275
|
-
};
|
|
1276
|
-
|
|
1277
|
-
exports.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
|
|
1278
|
-
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1279
|
-
return addHeapObject(ret);
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
exports.__wbg_next_138a17bbf04e926c = function(arg0) {
|
|
1283
|
-
const ret = getObject(arg0).next;
|
|
1284
|
-
return addHeapObject(ret);
|
|
1285
|
-
};
|
|
1286
|
-
|
|
1287
|
-
exports.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
|
|
1288
|
-
const ret = getObject(arg0).next();
|
|
1289
|
-
return addHeapObject(ret);
|
|
1290
|
-
}, arguments) };
|
|
1291
|
-
|
|
1292
|
-
exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
1293
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1294
|
-
};
|
|
1295
|
-
|
|
1296
|
-
exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
1297
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
1298
|
-
};
|
|
1299
|
-
|
|
1300
|
-
exports.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1301
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1302
|
-
return ret;
|
|
1303
|
-
}, arguments) };
|
|
1304
|
-
|
|
1305
|
-
exports.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
|
|
1306
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1307
|
-
};
|
|
1308
|
-
|
|
1309
|
-
exports.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
|
|
1310
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
1311
|
-
return addHeapObject(ret);
|
|
1312
|
-
};
|
|
1313
|
-
|
|
1314
|
-
exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
1315
|
-
const ret = getObject(arg1).stack;
|
|
1316
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1317
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1318
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1319
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1320
|
-
};
|
|
1321
|
-
|
|
1322
|
-
exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
1323
|
-
const ret = getObject(arg0).value;
|
|
1324
|
-
return addHeapObject(ret);
|
|
1325
|
-
};
|
|
1326
|
-
|
|
1327
|
-
exports.__wbg_wasminlineimage_new = function(arg0) {
|
|
1328
|
-
const ret = WasmInlineImage.__wrap(arg0);
|
|
1329
|
-
return addHeapObject(ret);
|
|
1330
|
-
};
|
|
1331
|
-
|
|
1332
|
-
exports.__wbg_wasminlineimagewarning_new = function(arg0) {
|
|
1333
|
-
const ret = WasmInlineImageWarning.__wrap(arg0);
|
|
1334
|
-
return addHeapObject(ret);
|
|
1335
|
-
};
|
|
1336
|
-
|
|
1337
|
-
exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1338
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1339
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1340
|
-
return addHeapObject(ret);
|
|
1341
|
-
};
|
|
1342
|
-
|
|
1343
|
-
exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
1344
|
-
// Cast intrinsic for `U64 -> Externref`.
|
|
1345
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
1346
|
-
return addHeapObject(ret);
|
|
1347
|
-
};
|
|
1348
|
-
|
|
1349
|
-
exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
1350
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
1351
|
-
const ret = arg0;
|
|
1352
|
-
return addHeapObject(ret);
|
|
1353
|
-
};
|
|
1354
|
-
|
|
1355
|
-
exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1356
|
-
const ret = getObject(arg0);
|
|
1357
|
-
return addHeapObject(ret);
|
|
1358
|
-
};
|
|
1359
|
-
|
|
1360
|
-
exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1361
|
-
takeObject(arg0);
|
|
1362
|
-
};
|
|
1363
|
-
|
|
1364
|
-
const wasmPath = `${__dirname}/html_to_markdown_wasm_bg.wasm`;
|
|
1365
|
-
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
1366
|
-
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
1367
|
-
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
1368
|
-
|
|
1369
|
-
wasm.__wbindgen_start();
|