html-to-markdown-wasm 2.4.0 → 2.4.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/dist/html_to_markdown_wasm.d.ts +96 -0
- package/dist/html_to_markdown_wasm.js +5 -0
- package/dist/html_to_markdown_wasm_bg.js +966 -0
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/html_to_markdown_wasm_bg.wasm.d.ts +32 -0
- package/dist/package.json +26 -0
- package/package.json +3 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Initialize panic hook for better error messages in the browser
|
|
5
|
+
*/
|
|
6
|
+
export function init(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Convert HTML to Markdown
|
|
9
|
+
*
|
|
10
|
+
* # Arguments
|
|
11
|
+
*
|
|
12
|
+
* * `html` - The HTML string to convert
|
|
13
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
14
|
+
*
|
|
15
|
+
* # Example
|
|
16
|
+
*
|
|
17
|
+
* ```javascript
|
|
18
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
19
|
+
*
|
|
20
|
+
* const html = '<h1>Hello World</h1>';
|
|
21
|
+
* const markdown = convert(html);
|
|
22
|
+
* console.log(markdown); // # Hello World
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function convert(html: string, options: any): string;
|
|
26
|
+
/**
|
|
27
|
+
* Convert HTML to Markdown while collecting inline images
|
|
28
|
+
*
|
|
29
|
+
* # Arguments
|
|
30
|
+
*
|
|
31
|
+
* * `html` - The HTML string to convert
|
|
32
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
33
|
+
* * `image_config` - Configuration for inline image extraction
|
|
34
|
+
*
|
|
35
|
+
* # Example
|
|
36
|
+
*
|
|
37
|
+
* ```javascript
|
|
38
|
+
* import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
|
|
39
|
+
*
|
|
40
|
+
* const html = '<img src="data:image/png;base64,..." alt="test">';
|
|
41
|
+
* const config = new WasmInlineImageConfig(1024 * 1024);
|
|
42
|
+
* config.inferDimensions = true;
|
|
43
|
+
*
|
|
44
|
+
* const result = convertWithInlineImages(html, null, config);
|
|
45
|
+
* console.log(result.markdown);
|
|
46
|
+
* console.log(result.inlineImages.length);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
50
|
+
/**
|
|
51
|
+
* Result of HTML extraction with inline images
|
|
52
|
+
*/
|
|
53
|
+
export class WasmHtmlExtraction {
|
|
54
|
+
private constructor();
|
|
55
|
+
free(): void;
|
|
56
|
+
[Symbol.dispose](): void;
|
|
57
|
+
readonly markdown: string;
|
|
58
|
+
readonly inlineImages: WasmInlineImage[];
|
|
59
|
+
readonly warnings: WasmInlineImageWarning[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Inline image data
|
|
63
|
+
*/
|
|
64
|
+
export class WasmInlineImage {
|
|
65
|
+
private constructor();
|
|
66
|
+
free(): void;
|
|
67
|
+
[Symbol.dispose](): void;
|
|
68
|
+
readonly data: Uint8Array;
|
|
69
|
+
readonly format: string;
|
|
70
|
+
readonly filename: string | undefined;
|
|
71
|
+
readonly description: string | undefined;
|
|
72
|
+
readonly dimensions: Uint32Array | undefined;
|
|
73
|
+
readonly source: string;
|
|
74
|
+
readonly attributes: any;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Inline image configuration
|
|
78
|
+
*/
|
|
79
|
+
export class WasmInlineImageConfig {
|
|
80
|
+
free(): void;
|
|
81
|
+
[Symbol.dispose](): void;
|
|
82
|
+
constructor(max_decoded_size_bytes?: number | null);
|
|
83
|
+
set filenamePrefix(value: string | null | undefined);
|
|
84
|
+
set captureSvg(value: boolean);
|
|
85
|
+
set inferDimensions(value: boolean);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Warning about inline image processing
|
|
89
|
+
*/
|
|
90
|
+
export class WasmInlineImageWarning {
|
|
91
|
+
private constructor();
|
|
92
|
+
free(): void;
|
|
93
|
+
[Symbol.dispose](): void;
|
|
94
|
+
readonly index: number;
|
|
95
|
+
readonly message: string;
|
|
96
|
+
}
|
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
export function __wbg_set_wasm(val) {
|
|
3
|
+
wasm = val;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
let cachedUint8ArrayMemory0 = null;
|
|
8
|
+
|
|
9
|
+
function getUint8ArrayMemory0() {
|
|
10
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
11
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
+
}
|
|
13
|
+
return cachedUint8ArrayMemory0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
17
|
+
|
|
18
|
+
cachedTextDecoder.decode();
|
|
19
|
+
|
|
20
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
21
|
+
let numBytesDecoded = 0;
|
|
22
|
+
function decodeText(ptr, len) {
|
|
23
|
+
numBytesDecoded += len;
|
|
24
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
25
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
26
|
+
cachedTextDecoder.decode();
|
|
27
|
+
numBytesDecoded = len;
|
|
28
|
+
}
|
|
29
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getStringFromWasm0(ptr, len) {
|
|
33
|
+
ptr = ptr >>> 0;
|
|
34
|
+
return decodeText(ptr, len);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let heap = new Array(128).fill(undefined);
|
|
38
|
+
|
|
39
|
+
heap.push(undefined, null, true, false);
|
|
40
|
+
|
|
41
|
+
let heap_next = heap.length;
|
|
42
|
+
|
|
43
|
+
function addHeapObject(obj) {
|
|
44
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
|
+
const idx = heap_next;
|
|
46
|
+
heap_next = heap[idx];
|
|
47
|
+
|
|
48
|
+
heap[idx] = obj;
|
|
49
|
+
return idx;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getObject(idx) { return heap[idx]; }
|
|
53
|
+
|
|
54
|
+
let WASM_VECTOR_LEN = 0;
|
|
55
|
+
|
|
56
|
+
const cachedTextEncoder = new TextEncoder();
|
|
57
|
+
|
|
58
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
59
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
60
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
61
|
+
view.set(buf);
|
|
62
|
+
return {
|
|
63
|
+
read: arg.length,
|
|
64
|
+
written: buf.length
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
70
|
+
|
|
71
|
+
if (realloc === undefined) {
|
|
72
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
73
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
74
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
75
|
+
WASM_VECTOR_LEN = buf.length;
|
|
76
|
+
return ptr;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let len = arg.length;
|
|
80
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
81
|
+
|
|
82
|
+
const mem = getUint8ArrayMemory0();
|
|
83
|
+
|
|
84
|
+
let offset = 0;
|
|
85
|
+
|
|
86
|
+
for (; offset < len; offset++) {
|
|
87
|
+
const code = arg.charCodeAt(offset);
|
|
88
|
+
if (code > 0x7F) break;
|
|
89
|
+
mem[ptr + offset] = code;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (offset !== len) {
|
|
93
|
+
if (offset !== 0) {
|
|
94
|
+
arg = arg.slice(offset);
|
|
95
|
+
}
|
|
96
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
97
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
98
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
99
|
+
|
|
100
|
+
offset += ret.written;
|
|
101
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
WASM_VECTOR_LEN = offset;
|
|
105
|
+
return ptr;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
let cachedDataViewMemory0 = null;
|
|
109
|
+
|
|
110
|
+
function getDataViewMemory0() {
|
|
111
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
112
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
113
|
+
}
|
|
114
|
+
return cachedDataViewMemory0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function handleError(f, args) {
|
|
118
|
+
try {
|
|
119
|
+
return f.apply(this, args);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
wasm.__wbindgen_export_2(addHeapObject(e));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
126
|
+
ptr = ptr >>> 0;
|
|
127
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function dropObject(idx) {
|
|
131
|
+
if (idx < 132) return;
|
|
132
|
+
heap[idx] = heap_next;
|
|
133
|
+
heap_next = idx;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function takeObject(idx) {
|
|
137
|
+
const ret = getObject(idx);
|
|
138
|
+
dropObject(idx);
|
|
139
|
+
return ret;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isLikeNone(x) {
|
|
143
|
+
return x === undefined || x === null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function debugString(val) {
|
|
147
|
+
// primitive types
|
|
148
|
+
const type = typeof val;
|
|
149
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
150
|
+
return `${val}`;
|
|
151
|
+
}
|
|
152
|
+
if (type == 'string') {
|
|
153
|
+
return `"${val}"`;
|
|
154
|
+
}
|
|
155
|
+
if (type == 'symbol') {
|
|
156
|
+
const description = val.description;
|
|
157
|
+
if (description == null) {
|
|
158
|
+
return 'Symbol';
|
|
159
|
+
} else {
|
|
160
|
+
return `Symbol(${description})`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (type == 'function') {
|
|
164
|
+
const name = val.name;
|
|
165
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
166
|
+
return `Function(${name})`;
|
|
167
|
+
} else {
|
|
168
|
+
return 'Function';
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// objects
|
|
172
|
+
if (Array.isArray(val)) {
|
|
173
|
+
const length = val.length;
|
|
174
|
+
let debug = '[';
|
|
175
|
+
if (length > 0) {
|
|
176
|
+
debug += debugString(val[0]);
|
|
177
|
+
}
|
|
178
|
+
for(let i = 1; i < length; i++) {
|
|
179
|
+
debug += ', ' + debugString(val[i]);
|
|
180
|
+
}
|
|
181
|
+
debug += ']';
|
|
182
|
+
return debug;
|
|
183
|
+
}
|
|
184
|
+
// Test for built-in
|
|
185
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
186
|
+
let className;
|
|
187
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
188
|
+
className = builtInMatches[1];
|
|
189
|
+
} else {
|
|
190
|
+
// Failed to match the standard '[object ClassName]'
|
|
191
|
+
return toString.call(val);
|
|
192
|
+
}
|
|
193
|
+
if (className == 'Object') {
|
|
194
|
+
// we're a user defined class or Object
|
|
195
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
196
|
+
// easier than looping through ownProperties of `val`.
|
|
197
|
+
try {
|
|
198
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
199
|
+
} catch (_) {
|
|
200
|
+
return 'Object';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// errors
|
|
204
|
+
if (val instanceof Error) {
|
|
205
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
206
|
+
}
|
|
207
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
208
|
+
return className;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let cachedUint32ArrayMemory0 = null;
|
|
212
|
+
|
|
213
|
+
function getUint32ArrayMemory0() {
|
|
214
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
215
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
216
|
+
}
|
|
217
|
+
return cachedUint32ArrayMemory0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
221
|
+
ptr = ptr >>> 0;
|
|
222
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
226
|
+
ptr = ptr >>> 0;
|
|
227
|
+
const mem = getDataViewMemory0();
|
|
228
|
+
const result = [];
|
|
229
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
230
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Initialize panic hook for better error messages in the browser
|
|
236
|
+
*/
|
|
237
|
+
export function init() {
|
|
238
|
+
wasm.init();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Convert HTML to Markdown
|
|
243
|
+
*
|
|
244
|
+
* # Arguments
|
|
245
|
+
*
|
|
246
|
+
* * `html` - The HTML string to convert
|
|
247
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
248
|
+
*
|
|
249
|
+
* # Example
|
|
250
|
+
*
|
|
251
|
+
* ```javascript
|
|
252
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
253
|
+
*
|
|
254
|
+
* const html = '<h1>Hello World</h1>';
|
|
255
|
+
* const markdown = convert(html);
|
|
256
|
+
* console.log(markdown); // # Hello World
|
|
257
|
+
* ```
|
|
258
|
+
* @param {string} html
|
|
259
|
+
* @param {any} options
|
|
260
|
+
* @returns {string}
|
|
261
|
+
*/
|
|
262
|
+
export function convert(html, options) {
|
|
263
|
+
let deferred3_0;
|
|
264
|
+
let deferred3_1;
|
|
265
|
+
try {
|
|
266
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
267
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
268
|
+
const len0 = WASM_VECTOR_LEN;
|
|
269
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
270
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
271
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
272
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
273
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
274
|
+
var ptr2 = r0;
|
|
275
|
+
var len2 = r1;
|
|
276
|
+
if (r3) {
|
|
277
|
+
ptr2 = 0; len2 = 0;
|
|
278
|
+
throw takeObject(r2);
|
|
279
|
+
}
|
|
280
|
+
deferred3_0 = ptr2;
|
|
281
|
+
deferred3_1 = len2;
|
|
282
|
+
return getStringFromWasm0(ptr2, len2);
|
|
283
|
+
} finally {
|
|
284
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
285
|
+
wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function _assertClass(instance, klass) {
|
|
290
|
+
if (!(instance instanceof klass)) {
|
|
291
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Convert HTML to Markdown while collecting inline images
|
|
296
|
+
*
|
|
297
|
+
* # Arguments
|
|
298
|
+
*
|
|
299
|
+
* * `html` - The HTML string to convert
|
|
300
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
301
|
+
* * `image_config` - Configuration for inline image extraction
|
|
302
|
+
*
|
|
303
|
+
* # Example
|
|
304
|
+
*
|
|
305
|
+
* ```javascript
|
|
306
|
+
* import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
|
|
307
|
+
*
|
|
308
|
+
* const html = '<img src="data:image/png;base64,..." alt="test">';
|
|
309
|
+
* const config = new WasmInlineImageConfig(1024 * 1024);
|
|
310
|
+
* config.inferDimensions = true;
|
|
311
|
+
*
|
|
312
|
+
* const result = convertWithInlineImages(html, null, config);
|
|
313
|
+
* console.log(result.markdown);
|
|
314
|
+
* console.log(result.inlineImages.length);
|
|
315
|
+
* ```
|
|
316
|
+
* @param {string} html
|
|
317
|
+
* @param {any} options
|
|
318
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
319
|
+
* @returns {WasmHtmlExtraction}
|
|
320
|
+
*/
|
|
321
|
+
export function convertWithInlineImages(html, options, image_config) {
|
|
322
|
+
try {
|
|
323
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
324
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
325
|
+
const len0 = WASM_VECTOR_LEN;
|
|
326
|
+
let ptr1 = 0;
|
|
327
|
+
if (!isLikeNone(image_config)) {
|
|
328
|
+
_assertClass(image_config, WasmInlineImageConfig);
|
|
329
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
330
|
+
}
|
|
331
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
332
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
333
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
334
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
335
|
+
if (r2) {
|
|
336
|
+
throw takeObject(r1);
|
|
337
|
+
}
|
|
338
|
+
return WasmHtmlExtraction.__wrap(r0);
|
|
339
|
+
} finally {
|
|
340
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
345
|
+
? { register: () => {}, unregister: () => {} }
|
|
346
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
347
|
+
/**
|
|
348
|
+
* Result of HTML extraction with inline images
|
|
349
|
+
*/
|
|
350
|
+
export class WasmHtmlExtraction {
|
|
351
|
+
|
|
352
|
+
static __wrap(ptr) {
|
|
353
|
+
ptr = ptr >>> 0;
|
|
354
|
+
const obj = Object.create(WasmHtmlExtraction.prototype);
|
|
355
|
+
obj.__wbg_ptr = ptr;
|
|
356
|
+
WasmHtmlExtractionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
357
|
+
return obj;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
__destroy_into_raw() {
|
|
361
|
+
const ptr = this.__wbg_ptr;
|
|
362
|
+
this.__wbg_ptr = 0;
|
|
363
|
+
WasmHtmlExtractionFinalization.unregister(this);
|
|
364
|
+
return ptr;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
free() {
|
|
368
|
+
const ptr = this.__destroy_into_raw();
|
|
369
|
+
wasm.__wbg_wasmhtmlextraction_free(ptr, 0);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @returns {string}
|
|
373
|
+
*/
|
|
374
|
+
get markdown() {
|
|
375
|
+
let deferred1_0;
|
|
376
|
+
let deferred1_1;
|
|
377
|
+
try {
|
|
378
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
+
wasm.wasmhtmlextraction_markdown(retptr, this.__wbg_ptr);
|
|
380
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
381
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
382
|
+
deferred1_0 = r0;
|
|
383
|
+
deferred1_1 = r1;
|
|
384
|
+
return getStringFromWasm0(r0, r1);
|
|
385
|
+
} finally {
|
|
386
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
387
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* @returns {WasmInlineImage[]}
|
|
392
|
+
*/
|
|
393
|
+
get inlineImages() {
|
|
394
|
+
try {
|
|
395
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
396
|
+
wasm.wasmhtmlextraction_inlineImages(retptr, this.__wbg_ptr);
|
|
397
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
398
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
399
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
400
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
401
|
+
return v1;
|
|
402
|
+
} finally {
|
|
403
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* @returns {WasmInlineImageWarning[]}
|
|
408
|
+
*/
|
|
409
|
+
get warnings() {
|
|
410
|
+
try {
|
|
411
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
412
|
+
wasm.wasmhtmlextraction_warnings(retptr, this.__wbg_ptr);
|
|
413
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
414
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
415
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
416
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
417
|
+
return v1;
|
|
418
|
+
} finally {
|
|
419
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (Symbol.dispose) WasmHtmlExtraction.prototype[Symbol.dispose] = WasmHtmlExtraction.prototype.free;
|
|
424
|
+
|
|
425
|
+
const WasmInlineImageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
426
|
+
? { register: () => {}, unregister: () => {} }
|
|
427
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimage_free(ptr >>> 0, 1));
|
|
428
|
+
/**
|
|
429
|
+
* Inline image data
|
|
430
|
+
*/
|
|
431
|
+
export class WasmInlineImage {
|
|
432
|
+
|
|
433
|
+
static __wrap(ptr) {
|
|
434
|
+
ptr = ptr >>> 0;
|
|
435
|
+
const obj = Object.create(WasmInlineImage.prototype);
|
|
436
|
+
obj.__wbg_ptr = ptr;
|
|
437
|
+
WasmInlineImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
438
|
+
return obj;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
__destroy_into_raw() {
|
|
442
|
+
const ptr = this.__wbg_ptr;
|
|
443
|
+
this.__wbg_ptr = 0;
|
|
444
|
+
WasmInlineImageFinalization.unregister(this);
|
|
445
|
+
return ptr;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
free() {
|
|
449
|
+
const ptr = this.__destroy_into_raw();
|
|
450
|
+
wasm.__wbg_wasminlineimage_free(ptr, 0);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @returns {Uint8Array}
|
|
454
|
+
*/
|
|
455
|
+
get data() {
|
|
456
|
+
const ret = wasm.wasminlineimage_data(this.__wbg_ptr);
|
|
457
|
+
return takeObject(ret);
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* @returns {string}
|
|
461
|
+
*/
|
|
462
|
+
get format() {
|
|
463
|
+
let deferred1_0;
|
|
464
|
+
let deferred1_1;
|
|
465
|
+
try {
|
|
466
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
467
|
+
wasm.wasminlineimage_format(retptr, this.__wbg_ptr);
|
|
468
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
469
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
470
|
+
deferred1_0 = r0;
|
|
471
|
+
deferred1_1 = r1;
|
|
472
|
+
return getStringFromWasm0(r0, r1);
|
|
473
|
+
} finally {
|
|
474
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
475
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* @returns {string | undefined}
|
|
480
|
+
*/
|
|
481
|
+
get filename() {
|
|
482
|
+
try {
|
|
483
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
484
|
+
wasm.wasminlineimage_filename(retptr, this.__wbg_ptr);
|
|
485
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
486
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
487
|
+
let v1;
|
|
488
|
+
if (r0 !== 0) {
|
|
489
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
490
|
+
wasm.__wbindgen_export_3(r0, r1 * 1, 1);
|
|
491
|
+
}
|
|
492
|
+
return v1;
|
|
493
|
+
} finally {
|
|
494
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* @returns {string | undefined}
|
|
499
|
+
*/
|
|
500
|
+
get description() {
|
|
501
|
+
try {
|
|
502
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
503
|
+
wasm.wasminlineimage_description(retptr, this.__wbg_ptr);
|
|
504
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
505
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
506
|
+
let v1;
|
|
507
|
+
if (r0 !== 0) {
|
|
508
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
509
|
+
wasm.__wbindgen_export_3(r0, r1 * 1, 1);
|
|
510
|
+
}
|
|
511
|
+
return v1;
|
|
512
|
+
} finally {
|
|
513
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* @returns {Uint32Array | undefined}
|
|
518
|
+
*/
|
|
519
|
+
get dimensions() {
|
|
520
|
+
try {
|
|
521
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
522
|
+
wasm.wasminlineimage_dimensions(retptr, this.__wbg_ptr);
|
|
523
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
524
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
525
|
+
let v1;
|
|
526
|
+
if (r0 !== 0) {
|
|
527
|
+
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
528
|
+
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
529
|
+
}
|
|
530
|
+
return v1;
|
|
531
|
+
} finally {
|
|
532
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* @returns {string}
|
|
537
|
+
*/
|
|
538
|
+
get source() {
|
|
539
|
+
let deferred1_0;
|
|
540
|
+
let deferred1_1;
|
|
541
|
+
try {
|
|
542
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
543
|
+
wasm.wasminlineimage_source(retptr, this.__wbg_ptr);
|
|
544
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
545
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
546
|
+
deferred1_0 = r0;
|
|
547
|
+
deferred1_1 = r1;
|
|
548
|
+
return getStringFromWasm0(r0, r1);
|
|
549
|
+
} finally {
|
|
550
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
551
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @returns {any}
|
|
556
|
+
*/
|
|
557
|
+
get attributes() {
|
|
558
|
+
const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
|
|
559
|
+
return takeObject(ret);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (Symbol.dispose) WasmInlineImage.prototype[Symbol.dispose] = WasmInlineImage.prototype.free;
|
|
563
|
+
|
|
564
|
+
const WasmInlineImageConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
565
|
+
? { register: () => {}, unregister: () => {} }
|
|
566
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimageconfig_free(ptr >>> 0, 1));
|
|
567
|
+
/**
|
|
568
|
+
* Inline image configuration
|
|
569
|
+
*/
|
|
570
|
+
export class WasmInlineImageConfig {
|
|
571
|
+
|
|
572
|
+
__destroy_into_raw() {
|
|
573
|
+
const ptr = this.__wbg_ptr;
|
|
574
|
+
this.__wbg_ptr = 0;
|
|
575
|
+
WasmInlineImageConfigFinalization.unregister(this);
|
|
576
|
+
return ptr;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
free() {
|
|
580
|
+
const ptr = this.__destroy_into_raw();
|
|
581
|
+
wasm.__wbg_wasminlineimageconfig_free(ptr, 0);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* @param {number | null} [max_decoded_size_bytes]
|
|
585
|
+
*/
|
|
586
|
+
constructor(max_decoded_size_bytes) {
|
|
587
|
+
const ret = wasm.wasminlineimageconfig_new(!isLikeNone(max_decoded_size_bytes), isLikeNone(max_decoded_size_bytes) ? 0 : max_decoded_size_bytes);
|
|
588
|
+
this.__wbg_ptr = ret >>> 0;
|
|
589
|
+
WasmInlineImageConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
590
|
+
return this;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* @param {string | null} [prefix]
|
|
594
|
+
*/
|
|
595
|
+
set filenamePrefix(prefix) {
|
|
596
|
+
var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
597
|
+
var len0 = WASM_VECTOR_LEN;
|
|
598
|
+
wasm.wasminlineimageconfig_set_filenamePrefix(this.__wbg_ptr, ptr0, len0);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* @param {boolean} capture
|
|
602
|
+
*/
|
|
603
|
+
set captureSvg(capture) {
|
|
604
|
+
wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* @param {boolean} infer
|
|
608
|
+
*/
|
|
609
|
+
set inferDimensions(infer) {
|
|
610
|
+
wasm.wasminlineimageconfig_set_inferDimensions(this.__wbg_ptr, infer);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
if (Symbol.dispose) WasmInlineImageConfig.prototype[Symbol.dispose] = WasmInlineImageConfig.prototype.free;
|
|
614
|
+
|
|
615
|
+
const WasmInlineImageWarningFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
616
|
+
? { register: () => {}, unregister: () => {} }
|
|
617
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminlineimagewarning_free(ptr >>> 0, 1));
|
|
618
|
+
/**
|
|
619
|
+
* Warning about inline image processing
|
|
620
|
+
*/
|
|
621
|
+
export class WasmInlineImageWarning {
|
|
622
|
+
|
|
623
|
+
static __wrap(ptr) {
|
|
624
|
+
ptr = ptr >>> 0;
|
|
625
|
+
const obj = Object.create(WasmInlineImageWarning.prototype);
|
|
626
|
+
obj.__wbg_ptr = ptr;
|
|
627
|
+
WasmInlineImageWarningFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
628
|
+
return obj;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
__destroy_into_raw() {
|
|
632
|
+
const ptr = this.__wbg_ptr;
|
|
633
|
+
this.__wbg_ptr = 0;
|
|
634
|
+
WasmInlineImageWarningFinalization.unregister(this);
|
|
635
|
+
return ptr;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
free() {
|
|
639
|
+
const ptr = this.__destroy_into_raw();
|
|
640
|
+
wasm.__wbg_wasminlineimagewarning_free(ptr, 0);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* @returns {number}
|
|
644
|
+
*/
|
|
645
|
+
get index() {
|
|
646
|
+
const ret = wasm.wasminlineimagewarning_index(this.__wbg_ptr);
|
|
647
|
+
return ret >>> 0;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* @returns {string}
|
|
651
|
+
*/
|
|
652
|
+
get message() {
|
|
653
|
+
let deferred1_0;
|
|
654
|
+
let deferred1_1;
|
|
655
|
+
try {
|
|
656
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
657
|
+
wasm.wasminlineimagewarning_message(retptr, this.__wbg_ptr);
|
|
658
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
659
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
660
|
+
deferred1_0 = r0;
|
|
661
|
+
deferred1_1 = r1;
|
|
662
|
+
return getStringFromWasm0(r0, r1);
|
|
663
|
+
} finally {
|
|
664
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
665
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
if (Symbol.dispose) WasmInlineImageWarning.prototype[Symbol.dispose] = WasmInlineImageWarning.prototype.free;
|
|
670
|
+
|
|
671
|
+
export function __wbg_Error_e17e777aac105295(arg0, arg1) {
|
|
672
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
673
|
+
return addHeapObject(ret);
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
export function __wbg_Number_998bea33bd87c3e0(arg0) {
|
|
677
|
+
const ret = Number(getObject(arg0));
|
|
678
|
+
return ret;
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
682
|
+
const ret = String(getObject(arg1));
|
|
683
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
684
|
+
const len1 = WASM_VECTOR_LEN;
|
|
685
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
686
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
export function __wbg_call_13410aac570ffff7() { return handleError(function (arg0, arg1) {
|
|
690
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
691
|
+
return addHeapObject(ret);
|
|
692
|
+
}, arguments) };
|
|
693
|
+
|
|
694
|
+
export function __wbg_codePointAt_6ee161d941249514(arg0, arg1) {
|
|
695
|
+
const ret = getObject(arg0).codePointAt(arg1 >>> 0);
|
|
696
|
+
return addHeapObject(ret);
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
export function __wbg_done_75ed0ee6dd243d9d(arg0) {
|
|
700
|
+
const ret = getObject(arg0).done;
|
|
701
|
+
return ret;
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
export function __wbg_entries_2be2f15bd5554996(arg0) {
|
|
705
|
+
const ret = Object.entries(getObject(arg0));
|
|
706
|
+
return addHeapObject(ret);
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
710
|
+
let deferred0_0;
|
|
711
|
+
let deferred0_1;
|
|
712
|
+
try {
|
|
713
|
+
deferred0_0 = arg0;
|
|
714
|
+
deferred0_1 = arg1;
|
|
715
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
716
|
+
} finally {
|
|
717
|
+
wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
export function __wbg_get_0da715ceaecea5c8(arg0, arg1) {
|
|
722
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
723
|
+
return addHeapObject(ret);
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
|
|
727
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
728
|
+
return addHeapObject(ret);
|
|
729
|
+
}, arguments) };
|
|
730
|
+
|
|
731
|
+
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
732
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
733
|
+
return addHeapObject(ret);
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
export function __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd(arg0) {
|
|
737
|
+
let result;
|
|
738
|
+
try {
|
|
739
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
740
|
+
} catch (_) {
|
|
741
|
+
result = false;
|
|
742
|
+
}
|
|
743
|
+
const ret = result;
|
|
744
|
+
return ret;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
export function __wbg_instanceof_Uint8Array_9a8378d955933db7(arg0) {
|
|
748
|
+
let result;
|
|
749
|
+
try {
|
|
750
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
751
|
+
} catch (_) {
|
|
752
|
+
result = false;
|
|
753
|
+
}
|
|
754
|
+
const ret = result;
|
|
755
|
+
return ret;
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
export function __wbg_isArray_030cce220591fb41(arg0) {
|
|
759
|
+
const ret = Array.isArray(getObject(arg0));
|
|
760
|
+
return ret;
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
export function __wbg_isSafeInteger_1c0d1af5542e102a(arg0) {
|
|
764
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
765
|
+
return ret;
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
export function __wbg_iterator_f370b34483c71a1c() {
|
|
769
|
+
const ret = Symbol.iterator;
|
|
770
|
+
return addHeapObject(ret);
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
export function __wbg_length_186546c51cd61acd(arg0) {
|
|
774
|
+
const ret = getObject(arg0).length;
|
|
775
|
+
return ret;
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
export function __wbg_length_6bb7e81f9d7713e4(arg0) {
|
|
779
|
+
const ret = getObject(arg0).length;
|
|
780
|
+
return ret;
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
export function __wbg_length_9d771c54845e987f(arg0) {
|
|
784
|
+
const ret = getObject(arg0).length;
|
|
785
|
+
return ret;
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
export function __wbg_new_19c25a3f2fa63a02() {
|
|
789
|
+
const ret = new Object();
|
|
790
|
+
return addHeapObject(ret);
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
export function __wbg_new_2ff1f68f3676ea53() {
|
|
794
|
+
const ret = new Map();
|
|
795
|
+
return addHeapObject(ret);
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
export function __wbg_new_638ebfaedbf32a5e(arg0) {
|
|
799
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
800
|
+
return addHeapObject(ret);
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
804
|
+
const ret = new Error();
|
|
805
|
+
return addHeapObject(ret);
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
export function __wbg_newfromslice_074c56947bd43469(arg0, arg1) {
|
|
809
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
810
|
+
return addHeapObject(ret);
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export function __wbg_next_5b3530e612fde77d(arg0) {
|
|
814
|
+
const ret = getObject(arg0).next;
|
|
815
|
+
return addHeapObject(ret);
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
export function __wbg_next_692e82279131b03c() { return handleError(function (arg0) {
|
|
819
|
+
const ret = getObject(arg0).next();
|
|
820
|
+
return addHeapObject(ret);
|
|
821
|
+
}, arguments) };
|
|
822
|
+
|
|
823
|
+
export function __wbg_prototypesetcall_3d4a26c1ed734349(arg0, arg1, arg2) {
|
|
824
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
828
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
export function __wbg_set_b7f1cf4fae26fe2a(arg0, arg1, arg2) {
|
|
832
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
833
|
+
return addHeapObject(ret);
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
837
|
+
const ret = getObject(arg1).stack;
|
|
838
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
839
|
+
const len1 = WASM_VECTOR_LEN;
|
|
840
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
841
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
export function __wbg_value_dd9372230531eade(arg0) {
|
|
845
|
+
const ret = getObject(arg0).value;
|
|
846
|
+
return addHeapObject(ret);
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
export function __wbg_wasminlineimage_new(arg0) {
|
|
850
|
+
const ret = WasmInlineImage.__wrap(arg0);
|
|
851
|
+
return addHeapObject(ret);
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
export function __wbg_wasminlineimagewarning_new(arg0) {
|
|
855
|
+
const ret = WasmInlineImageWarning.__wrap(arg0);
|
|
856
|
+
return addHeapObject(ret);
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
export function __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1(arg0, arg1) {
|
|
860
|
+
const v = getObject(arg1);
|
|
861
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
862
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
863
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
export function __wbg_wbindgenbooleanget_3fe6f642c7d97746(arg0) {
|
|
867
|
+
const v = getObject(arg0);
|
|
868
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
869
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
export function __wbg_wbindgendebugstring_99ef257a3ddda34d(arg0, arg1) {
|
|
873
|
+
const ret = debugString(getObject(arg1));
|
|
874
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
875
|
+
const len1 = WASM_VECTOR_LEN;
|
|
876
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
877
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
export function __wbg_wbindgenin_d7a1ee10933d2d55(arg0, arg1) {
|
|
881
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
882
|
+
return ret;
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
export function __wbg_wbindgenisbigint_ecb90cc08a5a9154(arg0) {
|
|
886
|
+
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
887
|
+
return ret;
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
export function __wbg_wbindgenisfunction_8cee7dce3725ae74(arg0) {
|
|
891
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
892
|
+
return ret;
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
export function __wbg_wbindgenisnull_f3037694abe4d97a(arg0) {
|
|
896
|
+
const ret = getObject(arg0) === null;
|
|
897
|
+
return ret;
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
export function __wbg_wbindgenisobject_307a53c6bd97fbf8(arg0) {
|
|
901
|
+
const val = getObject(arg0);
|
|
902
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
903
|
+
return ret;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
export function __wbg_wbindgenisstring_d4fa939789f003b0(arg0) {
|
|
907
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
908
|
+
return ret;
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
export function __wbg_wbindgenisundefined_c4b71d073b92f3c5(arg0) {
|
|
912
|
+
const ret = getObject(arg0) === undefined;
|
|
913
|
+
return ret;
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
export function __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58(arg0, arg1) {
|
|
917
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
918
|
+
return ret;
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
export function __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1(arg0, arg1) {
|
|
922
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
923
|
+
return ret;
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
export function __wbg_wbindgennumberget_f74b4c7525ac05cb(arg0, arg1) {
|
|
927
|
+
const obj = getObject(arg1);
|
|
928
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
929
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
930
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
export function __wbg_wbindgenstringget_0f16a6ddddef376f(arg0, arg1) {
|
|
934
|
+
const obj = getObject(arg1);
|
|
935
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
936
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
937
|
+
var len1 = WASM_VECTOR_LEN;
|
|
938
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
939
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
|
|
943
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
944
|
+
};
|
|
945
|
+
|
|
946
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
947
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
948
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
949
|
+
return addHeapObject(ret);
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
953
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
954
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
955
|
+
return addHeapObject(ret);
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
959
|
+
const ret = getObject(arg0);
|
|
960
|
+
return addHeapObject(ret);
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
964
|
+
takeObject(arg0);
|
|
965
|
+
};
|
|
966
|
+
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_wasminlineimageconfig_free: (a: number, b: number) => void;
|
|
5
|
+
export const wasminlineimageconfig_new: (a: number, b: number) => number;
|
|
6
|
+
export const wasminlineimageconfig_set_filenamePrefix: (a: number, b: number, c: number) => void;
|
|
7
|
+
export const wasminlineimageconfig_set_captureSvg: (a: number, b: number) => void;
|
|
8
|
+
export const wasminlineimageconfig_set_inferDimensions: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_wasminlineimage_free: (a: number, b: number) => void;
|
|
10
|
+
export const wasminlineimage_data: (a: number) => number;
|
|
11
|
+
export const wasminlineimage_format: (a: number, b: number) => void;
|
|
12
|
+
export const wasminlineimage_filename: (a: number, b: number) => void;
|
|
13
|
+
export const wasminlineimage_description: (a: number, b: number) => void;
|
|
14
|
+
export const wasminlineimage_dimensions: (a: number, b: number) => void;
|
|
15
|
+
export const wasminlineimage_source: (a: number, b: number) => void;
|
|
16
|
+
export const wasminlineimage_attributes: (a: number) => number;
|
|
17
|
+
export const __wbg_wasminlineimagewarning_free: (a: number, b: number) => void;
|
|
18
|
+
export const wasminlineimagewarning_index: (a: number) => number;
|
|
19
|
+
export const wasminlineimagewarning_message: (a: number, b: number) => void;
|
|
20
|
+
export const __wbg_wasmhtmlextraction_free: (a: number, b: number) => void;
|
|
21
|
+
export const wasmhtmlextraction_markdown: (a: number, b: number) => void;
|
|
22
|
+
export const wasmhtmlextraction_inlineImages: (a: number, b: number) => void;
|
|
23
|
+
export const wasmhtmlextraction_warnings: (a: number, b: number) => void;
|
|
24
|
+
export const convert: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const convertWithInlineImages: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
26
|
+
export const init: () => void;
|
|
27
|
+
export const __wbindgen_export_0: (a: number, b: number) => number;
|
|
28
|
+
export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
|
|
29
|
+
export const __wbindgen_export_2: (a: number) => void;
|
|
30
|
+
export const __wbindgen_export_3: (a: number, b: number, c: number) => void;
|
|
31
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
32
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "html-to-markdown-wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Na'aman Hirschfeld <nhirschfeld@gmail.com>"
|
|
6
|
+
],
|
|
7
|
+
"version": "2.4.1",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Goldziher/html-to-markdown"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"html_to_markdown_wasm_bg.wasm",
|
|
15
|
+
"html_to_markdown_wasm.js",
|
|
16
|
+
"html_to_markdown_wasm_bg.js",
|
|
17
|
+
"html_to_markdown_wasm.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"main": "html_to_markdown_wasm.js",
|
|
20
|
+
"homepage": "https://github.com/Goldziher/html-to-markdown",
|
|
21
|
+
"types": "html_to_markdown_wasm.d.ts",
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"./html_to_markdown_wasm.js",
|
|
24
|
+
"./snippets/*"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-to-markdown-wasm",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "High-performance HTML to Markdown converter - WebAssembly bindings",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"build": "wasm-pack build --target bundler --out-dir dist",
|
|
37
37
|
"build:nodejs": "wasm-pack build --target nodejs --out-dir dist-node",
|
|
38
38
|
"build:web": "wasm-pack build --target web --out-dir dist-web",
|
|
39
|
-
"build:all": "pnpm run build && pnpm run build:nodejs && pnpm run build:web",
|
|
39
|
+
"build:all": "pnpm run build && pnpm run build:nodejs && pnpm run build:web && pnpm run cleanup:gitignore",
|
|
40
|
+
"cleanup:gitignore": "node ./scripts/cleanup-gitignore.js",
|
|
40
41
|
"test": "vitest run",
|
|
41
42
|
"test:watch": "vitest",
|
|
42
43
|
"test:wasm-pack": "wasm-pack test --headless --chrome",
|