html-to-markdown-wasm 2.7.2 → 2.8.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 +4 -1
- package/dist/README.md +5 -2
- package/dist/html_to_markdown_wasm.d.ts +8 -8
- package/dist/html_to_markdown_wasm_bg.js +65 -65
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/package.json +1 -1
- package/dist-node/README.md +5 -2
- package/dist-node/html_to_markdown_wasm.d.ts +8 -8
- package/dist-node/html_to_markdown_wasm.js +65 -65
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/package.json +1 -1
- package/dist-web/README.md +5 -2
- package/dist-web/html_to_markdown_wasm.d.ts +8 -8
- package/dist-web/html_to_markdown_wasm.js +65 -65
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,12 +9,15 @@ Powered by the same Rust engine as the Node.js, Python, Ruby, and PHP bindings,
|
|
|
9
9
|
|
|
10
10
|
Runs anywhere: Node.js, Deno, Bun, browsers, and edge runtimes.
|
|
11
11
|
|
|
12
|
-
[](https://crates.io/crates/html-to-markdown)
|
|
13
13
|
[](https://www.npmjs.com/package/html-to-markdown-node)
|
|
14
14
|
[](https://www.npmjs.com/package/html-to-markdown-wasm)
|
|
15
15
|
[](https://pypi.org/project/html-to-markdown/)
|
|
16
16
|
[](https://packagist.org/packages/goldziher/html-to-markdown)
|
|
17
17
|
[](https://rubygems.org/gems/html-to-markdown)
|
|
18
|
+
[](https://www.nuget.org/packages/HtmlToMarkdown/)
|
|
19
|
+
[](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
|
|
20
|
+
[](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
|
|
18
21
|
[](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
|
|
19
22
|
|
|
20
23
|
## Performance
|
package/dist/README.md
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
High-performance HTML → Markdown conversion powered by Rust. Shipping as a Rust crate, Python package, PHP extension, Ruby gem, Node.js bindings, WebAssembly, and standalone CLI with identical rendering behaviour.
|
|
4
4
|
|
|
5
|
-
[](https://crates.io/crates/html-to-markdown)
|
|
6
6
|
[](https://www.npmjs.com/package/html-to-markdown-node)
|
|
7
7
|
[](https://www.npmjs.com/package/html-to-markdown-wasm)
|
|
8
8
|
[](https://pypi.org/project/html-to-markdown/)
|
|
9
9
|
[](https://packagist.org/packages/goldziher/html-to-markdown)
|
|
10
10
|
[](https://rubygems.org/gems/html-to-markdown)
|
|
11
|
+
[](https://www.nuget.org/packages/HtmlToMarkdown/)
|
|
12
|
+
[](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
|
|
13
|
+
[](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
|
|
11
14
|
[](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
|
|
12
15
|
[](https://discord.gg/pXxagNK2zN)
|
|
13
16
|
|
|
@@ -89,7 +92,7 @@ const markdown = convert(html, {
|
|
|
89
92
|
});
|
|
90
93
|
```
|
|
91
94
|
|
|
92
|
-
**Performance:** The shared fixture harness (`task bench:bindings`) now clocks Node, Python, and the Rust CLI at ~1.3–1.4k ops/sec (≈150
|
|
95
|
+
**Performance:** The shared fixture harness (`task bench:bindings`) now clocks C# at ~1.4k ops/sec (≈171 MB/s), Go at ~1.3k ops/sec (≈165 MB/s), Node, Python, and the Rust CLI at ~1.3–1.4k ops/sec (≈150 MB/s) on the 129 KB Wikipedia "Lists" page thanks to the new Buffer/Uint8Array fast paths and release-mode harness. Ruby stays close at ~1.2k ops/sec (≈150 MB/s), Java lands at ~1.0k ops/sec (≈126 MB/s), WASM hits ~0.85k ops/sec (≈108 MB/s), and PHP achieves ~0.3k ops/sec (≈35 MB/s)—all providing excellent throughput for production workloads.
|
|
93
96
|
|
|
94
97
|
See the JavaScript guides for full API documentation:
|
|
95
98
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Initialize panic hook for better error messages in the browser
|
|
5
|
+
*/
|
|
6
|
+
export function init(): void;
|
|
7
|
+
export function convertBytes(html: Uint8Array, options: any): string;
|
|
4
8
|
/**
|
|
5
9
|
* Convert HTML to Markdown
|
|
6
10
|
*
|
|
@@ -20,15 +24,11 @@ export function createConversionOptionsHandle(options: any): WasmConversionOptio
|
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
26
|
export function convert(html: string, options: any): string;
|
|
23
|
-
export function convertBytes(html: Uint8Array, options: any): string;
|
|
24
|
-
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
25
|
-
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
26
27
|
export function convertBytesWithOptionsHandle(html: Uint8Array, handle: WasmConversionOptionsHandle): string;
|
|
27
|
-
|
|
28
|
-
* Initialize panic hook for better error messages in the browser
|
|
29
|
-
*/
|
|
30
|
-
export function init(): void;
|
|
28
|
+
export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
|
|
31
29
|
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
30
|
+
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
31
|
+
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
32
32
|
export class WasmConversionOptionsHandle {
|
|
33
33
|
free(): void;
|
|
34
34
|
[Symbol.dispose](): void;
|
|
@@ -232,22 +232,39 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
232
232
|
return result;
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
|
+
* Initialize panic hook for better error messages in the browser
|
|
236
|
+
*/
|
|
237
|
+
export function init() {
|
|
238
|
+
wasm.init();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @param {Uint8Array} html
|
|
235
243
|
* @param {any} options
|
|
236
|
-
* @returns {
|
|
244
|
+
* @returns {string}
|
|
237
245
|
*/
|
|
238
|
-
export function
|
|
246
|
+
export function convertBytes(html, options) {
|
|
247
|
+
let deferred2_0;
|
|
248
|
+
let deferred2_1;
|
|
239
249
|
try {
|
|
240
250
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
241
|
-
wasm.
|
|
251
|
+
wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
|
|
242
252
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
243
253
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
244
254
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
245
|
-
|
|
246
|
-
|
|
255
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
256
|
+
var ptr1 = r0;
|
|
257
|
+
var len1 = r1;
|
|
258
|
+
if (r3) {
|
|
259
|
+
ptr1 = 0; len1 = 0;
|
|
260
|
+
throw takeObject(r2);
|
|
247
261
|
}
|
|
248
|
-
|
|
262
|
+
deferred2_0 = ptr1;
|
|
263
|
+
deferred2_1 = len1;
|
|
264
|
+
return getStringFromWasm0(ptr1, len1);
|
|
249
265
|
} finally {
|
|
250
266
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
267
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
251
268
|
}
|
|
252
269
|
}
|
|
253
270
|
|
|
@@ -299,17 +316,23 @@ export function convert(html, options) {
|
|
|
299
316
|
}
|
|
300
317
|
}
|
|
301
318
|
|
|
319
|
+
function _assertClass(instance, klass) {
|
|
320
|
+
if (!(instance instanceof klass)) {
|
|
321
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
302
324
|
/**
|
|
303
325
|
* @param {Uint8Array} html
|
|
304
|
-
* @param {
|
|
326
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
305
327
|
* @returns {string}
|
|
306
328
|
*/
|
|
307
|
-
export function
|
|
329
|
+
export function convertBytesWithOptionsHandle(html, handle) {
|
|
308
330
|
let deferred2_0;
|
|
309
331
|
let deferred2_1;
|
|
310
332
|
try {
|
|
311
333
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
312
|
-
|
|
334
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
335
|
+
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
313
336
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
314
337
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
315
338
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -329,59 +352,43 @@ export function convertBytes(html, options) {
|
|
|
329
352
|
}
|
|
330
353
|
}
|
|
331
354
|
|
|
332
|
-
function _assertClass(instance, klass) {
|
|
333
|
-
if (!(instance instanceof klass)) {
|
|
334
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
355
|
/**
|
|
338
|
-
* @param {
|
|
339
|
-
* @
|
|
340
|
-
* @returns {string}
|
|
356
|
+
* @param {any} options
|
|
357
|
+
* @returns {WasmConversionOptionsHandle}
|
|
341
358
|
*/
|
|
342
|
-
export function
|
|
343
|
-
let deferred3_0;
|
|
344
|
-
let deferred3_1;
|
|
359
|
+
export function createConversionOptionsHandle(options) {
|
|
345
360
|
try {
|
|
346
361
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
347
|
-
|
|
348
|
-
const len0 = WASM_VECTOR_LEN;
|
|
349
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
350
|
-
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
362
|
+
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
351
363
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
352
364
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
353
365
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
var len2 = r1;
|
|
357
|
-
if (r3) {
|
|
358
|
-
ptr2 = 0; len2 = 0;
|
|
359
|
-
throw takeObject(r2);
|
|
366
|
+
if (r2) {
|
|
367
|
+
throw takeObject(r1);
|
|
360
368
|
}
|
|
361
|
-
|
|
362
|
-
deferred3_1 = len2;
|
|
363
|
-
return getStringFromWasm0(ptr2, len2);
|
|
369
|
+
return WasmConversionOptionsHandle.__wrap(r0);
|
|
364
370
|
} finally {
|
|
365
371
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
366
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
367
372
|
}
|
|
368
373
|
}
|
|
369
374
|
|
|
370
375
|
/**
|
|
371
|
-
* @param {
|
|
376
|
+
* @param {string} html
|
|
372
377
|
* @param {any} options
|
|
373
378
|
* @param {WasmInlineImageConfig | null} [image_config]
|
|
374
379
|
* @returns {WasmHtmlExtraction}
|
|
375
380
|
*/
|
|
376
|
-
export function
|
|
381
|
+
export function convertWithInlineImages(html, options, image_config) {
|
|
377
382
|
try {
|
|
378
383
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
-
|
|
384
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
385
|
+
const len0 = WASM_VECTOR_LEN;
|
|
386
|
+
let ptr1 = 0;
|
|
380
387
|
if (!isLikeNone(image_config)) {
|
|
381
388
|
_assertClass(image_config, WasmInlineImageConfig);
|
|
382
|
-
|
|
389
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
383
390
|
}
|
|
384
|
-
wasm.
|
|
391
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
385
392
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
386
393
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
387
394
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -395,60 +402,53 @@ export function convertBytesWithInlineImages(html, options, image_config) {
|
|
|
395
402
|
}
|
|
396
403
|
|
|
397
404
|
/**
|
|
398
|
-
* @param {
|
|
405
|
+
* @param {string} html
|
|
399
406
|
* @param {WasmConversionOptionsHandle} handle
|
|
400
407
|
* @returns {string}
|
|
401
408
|
*/
|
|
402
|
-
export function
|
|
403
|
-
let
|
|
404
|
-
let
|
|
409
|
+
export function convertWithOptionsHandle(html, handle) {
|
|
410
|
+
let deferred3_0;
|
|
411
|
+
let deferred3_1;
|
|
405
412
|
try {
|
|
406
413
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
414
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
415
|
+
const len0 = WASM_VECTOR_LEN;
|
|
407
416
|
_assertClass(handle, WasmConversionOptionsHandle);
|
|
408
|
-
wasm.
|
|
417
|
+
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
409
418
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
410
419
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
411
420
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
412
421
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
413
|
-
var
|
|
414
|
-
var
|
|
422
|
+
var ptr2 = r0;
|
|
423
|
+
var len2 = r1;
|
|
415
424
|
if (r3) {
|
|
416
|
-
|
|
425
|
+
ptr2 = 0; len2 = 0;
|
|
417
426
|
throw takeObject(r2);
|
|
418
427
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
return getStringFromWasm0(
|
|
428
|
+
deferred3_0 = ptr2;
|
|
429
|
+
deferred3_1 = len2;
|
|
430
|
+
return getStringFromWasm0(ptr2, len2);
|
|
422
431
|
} finally {
|
|
423
432
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
424
|
-
wasm.__wbindgen_export4(
|
|
433
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
425
434
|
}
|
|
426
435
|
}
|
|
427
436
|
|
|
428
437
|
/**
|
|
429
|
-
*
|
|
430
|
-
*/
|
|
431
|
-
export function init() {
|
|
432
|
-
wasm.init();
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* @param {string} html
|
|
438
|
+
* @param {Uint8Array} html
|
|
437
439
|
* @param {any} options
|
|
438
440
|
* @param {WasmInlineImageConfig | null} [image_config]
|
|
439
441
|
* @returns {WasmHtmlExtraction}
|
|
440
442
|
*/
|
|
441
|
-
export function
|
|
443
|
+
export function convertBytesWithInlineImages(html, options, image_config) {
|
|
442
444
|
try {
|
|
443
445
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
444
|
-
|
|
445
|
-
const len0 = WASM_VECTOR_LEN;
|
|
446
|
-
let ptr1 = 0;
|
|
446
|
+
let ptr0 = 0;
|
|
447
447
|
if (!isLikeNone(image_config)) {
|
|
448
448
|
_assertClass(image_config, WasmInlineImageConfig);
|
|
449
|
-
|
|
449
|
+
ptr0 = image_config.__destroy_into_raw();
|
|
450
450
|
}
|
|
451
|
-
wasm.
|
|
451
|
+
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
452
452
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
453
453
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
454
454
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
Binary file
|
package/dist/package.json
CHANGED
package/dist-node/README.md
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
High-performance HTML → Markdown conversion powered by Rust. Shipping as a Rust crate, Python package, PHP extension, Ruby gem, Node.js bindings, WebAssembly, and standalone CLI with identical rendering behaviour.
|
|
4
4
|
|
|
5
|
-
[](https://crates.io/crates/html-to-markdown)
|
|
6
6
|
[](https://www.npmjs.com/package/html-to-markdown-node)
|
|
7
7
|
[](https://www.npmjs.com/package/html-to-markdown-wasm)
|
|
8
8
|
[](https://pypi.org/project/html-to-markdown/)
|
|
9
9
|
[](https://packagist.org/packages/goldziher/html-to-markdown)
|
|
10
10
|
[](https://rubygems.org/gems/html-to-markdown)
|
|
11
|
+
[](https://www.nuget.org/packages/HtmlToMarkdown/)
|
|
12
|
+
[](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
|
|
13
|
+
[](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
|
|
11
14
|
[](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
|
|
12
15
|
[](https://discord.gg/pXxagNK2zN)
|
|
13
16
|
|
|
@@ -89,7 +92,7 @@ const markdown = convert(html, {
|
|
|
89
92
|
});
|
|
90
93
|
```
|
|
91
94
|
|
|
92
|
-
**Performance:** The shared fixture harness (`task bench:bindings`) now clocks Node, Python, and the Rust CLI at ~1.3–1.4k ops/sec (≈150
|
|
95
|
+
**Performance:** The shared fixture harness (`task bench:bindings`) now clocks C# at ~1.4k ops/sec (≈171 MB/s), Go at ~1.3k ops/sec (≈165 MB/s), Node, Python, and the Rust CLI at ~1.3–1.4k ops/sec (≈150 MB/s) on the 129 KB Wikipedia "Lists" page thanks to the new Buffer/Uint8Array fast paths and release-mode harness. Ruby stays close at ~1.2k ops/sec (≈150 MB/s), Java lands at ~1.0k ops/sec (≈126 MB/s), WASM hits ~0.85k ops/sec (≈108 MB/s), and PHP achieves ~0.3k ops/sec (≈35 MB/s)—all providing excellent throughput for production workloads.
|
|
93
96
|
|
|
94
97
|
See the JavaScript guides for full API documentation:
|
|
95
98
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Initialize panic hook for better error messages in the browser
|
|
5
|
+
*/
|
|
6
|
+
export function init(): void;
|
|
7
|
+
export function convertBytes(html: Uint8Array, options: any): string;
|
|
4
8
|
/**
|
|
5
9
|
* Convert HTML to Markdown
|
|
6
10
|
*
|
|
@@ -20,15 +24,11 @@ export function createConversionOptionsHandle(options: any): WasmConversionOptio
|
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
26
|
export function convert(html: string, options: any): string;
|
|
23
|
-
export function convertBytes(html: Uint8Array, options: any): string;
|
|
24
|
-
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
25
|
-
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
26
27
|
export function convertBytesWithOptionsHandle(html: Uint8Array, handle: WasmConversionOptionsHandle): string;
|
|
27
|
-
|
|
28
|
-
* Initialize panic hook for better error messages in the browser
|
|
29
|
-
*/
|
|
30
|
-
export function init(): void;
|
|
28
|
+
export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
|
|
31
29
|
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
30
|
+
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
31
|
+
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
32
32
|
export class WasmConversionOptionsHandle {
|
|
33
33
|
free(): void;
|
|
34
34
|
[Symbol.dispose](): void;
|
|
@@ -222,22 +222,39 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
222
222
|
return result;
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
|
+
* Initialize panic hook for better error messages in the browser
|
|
226
|
+
*/
|
|
227
|
+
exports.init = function() {
|
|
228
|
+
wasm.init();
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @param {Uint8Array} html
|
|
225
233
|
* @param {any} options
|
|
226
|
-
* @returns {
|
|
234
|
+
* @returns {string}
|
|
227
235
|
*/
|
|
228
|
-
exports.
|
|
236
|
+
exports.convertBytes = function(html, options) {
|
|
237
|
+
let deferred2_0;
|
|
238
|
+
let deferred2_1;
|
|
229
239
|
try {
|
|
230
240
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
231
|
-
wasm.
|
|
241
|
+
wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
|
|
232
242
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
233
243
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
234
244
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
246
|
+
var ptr1 = r0;
|
|
247
|
+
var len1 = r1;
|
|
248
|
+
if (r3) {
|
|
249
|
+
ptr1 = 0; len1 = 0;
|
|
250
|
+
throw takeObject(r2);
|
|
237
251
|
}
|
|
238
|
-
|
|
252
|
+
deferred2_0 = ptr1;
|
|
253
|
+
deferred2_1 = len1;
|
|
254
|
+
return getStringFromWasm0(ptr1, len1);
|
|
239
255
|
} finally {
|
|
240
256
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
257
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
241
258
|
}
|
|
242
259
|
};
|
|
243
260
|
|
|
@@ -289,17 +306,23 @@ exports.convert = function(html, options) {
|
|
|
289
306
|
}
|
|
290
307
|
};
|
|
291
308
|
|
|
309
|
+
function _assertClass(instance, klass) {
|
|
310
|
+
if (!(instance instanceof klass)) {
|
|
311
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
292
314
|
/**
|
|
293
315
|
* @param {Uint8Array} html
|
|
294
|
-
* @param {
|
|
316
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
295
317
|
* @returns {string}
|
|
296
318
|
*/
|
|
297
|
-
exports.
|
|
319
|
+
exports.convertBytesWithOptionsHandle = function(html, handle) {
|
|
298
320
|
let deferred2_0;
|
|
299
321
|
let deferred2_1;
|
|
300
322
|
try {
|
|
301
323
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
302
|
-
|
|
324
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
325
|
+
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
303
326
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
304
327
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
305
328
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -319,59 +342,43 @@ exports.convertBytes = function(html, options) {
|
|
|
319
342
|
}
|
|
320
343
|
};
|
|
321
344
|
|
|
322
|
-
function _assertClass(instance, klass) {
|
|
323
|
-
if (!(instance instanceof klass)) {
|
|
324
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
345
|
/**
|
|
328
|
-
* @param {
|
|
329
|
-
* @
|
|
330
|
-
* @returns {string}
|
|
346
|
+
* @param {any} options
|
|
347
|
+
* @returns {WasmConversionOptionsHandle}
|
|
331
348
|
*/
|
|
332
|
-
exports.
|
|
333
|
-
let deferred3_0;
|
|
334
|
-
let deferred3_1;
|
|
349
|
+
exports.createConversionOptionsHandle = function(options) {
|
|
335
350
|
try {
|
|
336
351
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
337
|
-
|
|
338
|
-
const len0 = WASM_VECTOR_LEN;
|
|
339
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
340
|
-
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
352
|
+
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
341
353
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
342
354
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
343
355
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
var len2 = r1;
|
|
347
|
-
if (r3) {
|
|
348
|
-
ptr2 = 0; len2 = 0;
|
|
349
|
-
throw takeObject(r2);
|
|
356
|
+
if (r2) {
|
|
357
|
+
throw takeObject(r1);
|
|
350
358
|
}
|
|
351
|
-
|
|
352
|
-
deferred3_1 = len2;
|
|
353
|
-
return getStringFromWasm0(ptr2, len2);
|
|
359
|
+
return WasmConversionOptionsHandle.__wrap(r0);
|
|
354
360
|
} finally {
|
|
355
361
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
356
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
357
362
|
}
|
|
358
363
|
};
|
|
359
364
|
|
|
360
365
|
/**
|
|
361
|
-
* @param {
|
|
366
|
+
* @param {string} html
|
|
362
367
|
* @param {any} options
|
|
363
368
|
* @param {WasmInlineImageConfig | null} [image_config]
|
|
364
369
|
* @returns {WasmHtmlExtraction}
|
|
365
370
|
*/
|
|
366
|
-
exports.
|
|
371
|
+
exports.convertWithInlineImages = function(html, options, image_config) {
|
|
367
372
|
try {
|
|
368
373
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
369
|
-
|
|
374
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
375
|
+
const len0 = WASM_VECTOR_LEN;
|
|
376
|
+
let ptr1 = 0;
|
|
370
377
|
if (!isLikeNone(image_config)) {
|
|
371
378
|
_assertClass(image_config, WasmInlineImageConfig);
|
|
372
|
-
|
|
379
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
373
380
|
}
|
|
374
|
-
wasm.
|
|
381
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
375
382
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
376
383
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
377
384
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -385,60 +392,53 @@ exports.convertBytesWithInlineImages = function(html, options, image_config) {
|
|
|
385
392
|
};
|
|
386
393
|
|
|
387
394
|
/**
|
|
388
|
-
* @param {
|
|
395
|
+
* @param {string} html
|
|
389
396
|
* @param {WasmConversionOptionsHandle} handle
|
|
390
397
|
* @returns {string}
|
|
391
398
|
*/
|
|
392
|
-
exports.
|
|
393
|
-
let
|
|
394
|
-
let
|
|
399
|
+
exports.convertWithOptionsHandle = function(html, handle) {
|
|
400
|
+
let deferred3_0;
|
|
401
|
+
let deferred3_1;
|
|
395
402
|
try {
|
|
396
403
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
404
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
405
|
+
const len0 = WASM_VECTOR_LEN;
|
|
397
406
|
_assertClass(handle, WasmConversionOptionsHandle);
|
|
398
|
-
wasm.
|
|
407
|
+
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
399
408
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
400
409
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
401
410
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
402
411
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
403
|
-
var
|
|
404
|
-
var
|
|
412
|
+
var ptr2 = r0;
|
|
413
|
+
var len2 = r1;
|
|
405
414
|
if (r3) {
|
|
406
|
-
|
|
415
|
+
ptr2 = 0; len2 = 0;
|
|
407
416
|
throw takeObject(r2);
|
|
408
417
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return getStringFromWasm0(
|
|
418
|
+
deferred3_0 = ptr2;
|
|
419
|
+
deferred3_1 = len2;
|
|
420
|
+
return getStringFromWasm0(ptr2, len2);
|
|
412
421
|
} finally {
|
|
413
422
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
414
|
-
wasm.__wbindgen_export4(
|
|
423
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
415
424
|
}
|
|
416
425
|
};
|
|
417
426
|
|
|
418
427
|
/**
|
|
419
|
-
*
|
|
420
|
-
*/
|
|
421
|
-
exports.init = function() {
|
|
422
|
-
wasm.init();
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* @param {string} html
|
|
428
|
+
* @param {Uint8Array} html
|
|
427
429
|
* @param {any} options
|
|
428
430
|
* @param {WasmInlineImageConfig | null} [image_config]
|
|
429
431
|
* @returns {WasmHtmlExtraction}
|
|
430
432
|
*/
|
|
431
|
-
exports.
|
|
433
|
+
exports.convertBytesWithInlineImages = function(html, options, image_config) {
|
|
432
434
|
try {
|
|
433
435
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
434
|
-
|
|
435
|
-
const len0 = WASM_VECTOR_LEN;
|
|
436
|
-
let ptr1 = 0;
|
|
436
|
+
let ptr0 = 0;
|
|
437
437
|
if (!isLikeNone(image_config)) {
|
|
438
438
|
_assertClass(image_config, WasmInlineImageConfig);
|
|
439
|
-
|
|
439
|
+
ptr0 = image_config.__destroy_into_raw();
|
|
440
440
|
}
|
|
441
|
-
wasm.
|
|
441
|
+
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
442
442
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
443
443
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
444
444
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
Binary file
|
package/dist-node/package.json
CHANGED
package/dist-web/README.md
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
High-performance HTML → Markdown conversion powered by Rust. Shipping as a Rust crate, Python package, PHP extension, Ruby gem, Node.js bindings, WebAssembly, and standalone CLI with identical rendering behaviour.
|
|
4
4
|
|
|
5
|
-
[](https://crates.io/crates/html-to-markdown)
|
|
6
6
|
[](https://www.npmjs.com/package/html-to-markdown-node)
|
|
7
7
|
[](https://www.npmjs.com/package/html-to-markdown-wasm)
|
|
8
8
|
[](https://pypi.org/project/html-to-markdown/)
|
|
9
9
|
[](https://packagist.org/packages/goldziher/html-to-markdown)
|
|
10
10
|
[](https://rubygems.org/gems/html-to-markdown)
|
|
11
|
+
[](https://www.nuget.org/packages/HtmlToMarkdown/)
|
|
12
|
+
[](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
|
|
13
|
+
[](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
|
|
11
14
|
[](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
|
|
12
15
|
[](https://discord.gg/pXxagNK2zN)
|
|
13
16
|
|
|
@@ -89,7 +92,7 @@ const markdown = convert(html, {
|
|
|
89
92
|
});
|
|
90
93
|
```
|
|
91
94
|
|
|
92
|
-
**Performance:** The shared fixture harness (`task bench:bindings`) now clocks Node, Python, and the Rust CLI at ~1.3–1.4k ops/sec (≈150
|
|
95
|
+
**Performance:** The shared fixture harness (`task bench:bindings`) now clocks C# at ~1.4k ops/sec (≈171 MB/s), Go at ~1.3k ops/sec (≈165 MB/s), Node, Python, and the Rust CLI at ~1.3–1.4k ops/sec (≈150 MB/s) on the 129 KB Wikipedia "Lists" page thanks to the new Buffer/Uint8Array fast paths and release-mode harness. Ruby stays close at ~1.2k ops/sec (≈150 MB/s), Java lands at ~1.0k ops/sec (≈126 MB/s), WASM hits ~0.85k ops/sec (≈108 MB/s), and PHP achieves ~0.3k ops/sec (≈35 MB/s)—all providing excellent throughput for production workloads.
|
|
93
96
|
|
|
94
97
|
See the JavaScript guides for full API documentation:
|
|
95
98
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Initialize panic hook for better error messages in the browser
|
|
5
|
+
*/
|
|
6
|
+
export function init(): void;
|
|
7
|
+
export function convertBytes(html: Uint8Array, options: any): string;
|
|
4
8
|
/**
|
|
5
9
|
* Convert HTML to Markdown
|
|
6
10
|
*
|
|
@@ -20,15 +24,11 @@ export function createConversionOptionsHandle(options: any): WasmConversionOptio
|
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
26
|
export function convert(html: string, options: any): string;
|
|
23
|
-
export function convertBytes(html: Uint8Array, options: any): string;
|
|
24
|
-
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
25
|
-
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
26
27
|
export function convertBytesWithOptionsHandle(html: Uint8Array, handle: WasmConversionOptionsHandle): string;
|
|
27
|
-
|
|
28
|
-
* Initialize panic hook for better error messages in the browser
|
|
29
|
-
*/
|
|
30
|
-
export function init(): void;
|
|
28
|
+
export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
|
|
31
29
|
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
30
|
+
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
31
|
+
export function convertBytesWithInlineImages(html: Uint8Array, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
32
32
|
export class WasmConversionOptionsHandle {
|
|
33
33
|
free(): void;
|
|
34
34
|
[Symbol.dispose](): void;
|
|
@@ -228,22 +228,39 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
228
228
|
return result;
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
|
+
* Initialize panic hook for better error messages in the browser
|
|
232
|
+
*/
|
|
233
|
+
export function init() {
|
|
234
|
+
wasm.init();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @param {Uint8Array} html
|
|
231
239
|
* @param {any} options
|
|
232
|
-
* @returns {
|
|
240
|
+
* @returns {string}
|
|
233
241
|
*/
|
|
234
|
-
export function
|
|
242
|
+
export function convertBytes(html, options) {
|
|
243
|
+
let deferred2_0;
|
|
244
|
+
let deferred2_1;
|
|
235
245
|
try {
|
|
236
246
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
237
|
-
wasm.
|
|
247
|
+
wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
|
|
238
248
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
239
249
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
240
250
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
241
|
-
|
|
242
|
-
|
|
251
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
252
|
+
var ptr1 = r0;
|
|
253
|
+
var len1 = r1;
|
|
254
|
+
if (r3) {
|
|
255
|
+
ptr1 = 0; len1 = 0;
|
|
256
|
+
throw takeObject(r2);
|
|
243
257
|
}
|
|
244
|
-
|
|
258
|
+
deferred2_0 = ptr1;
|
|
259
|
+
deferred2_1 = len1;
|
|
260
|
+
return getStringFromWasm0(ptr1, len1);
|
|
245
261
|
} finally {
|
|
246
262
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
263
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
247
264
|
}
|
|
248
265
|
}
|
|
249
266
|
|
|
@@ -295,17 +312,23 @@ export function convert(html, options) {
|
|
|
295
312
|
}
|
|
296
313
|
}
|
|
297
314
|
|
|
315
|
+
function _assertClass(instance, klass) {
|
|
316
|
+
if (!(instance instanceof klass)) {
|
|
317
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
298
320
|
/**
|
|
299
321
|
* @param {Uint8Array} html
|
|
300
|
-
* @param {
|
|
322
|
+
* @param {WasmConversionOptionsHandle} handle
|
|
301
323
|
* @returns {string}
|
|
302
324
|
*/
|
|
303
|
-
export function
|
|
325
|
+
export function convertBytesWithOptionsHandle(html, handle) {
|
|
304
326
|
let deferred2_0;
|
|
305
327
|
let deferred2_1;
|
|
306
328
|
try {
|
|
307
329
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
308
|
-
|
|
330
|
+
_assertClass(handle, WasmConversionOptionsHandle);
|
|
331
|
+
wasm.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
|
|
309
332
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
310
333
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
311
334
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -325,59 +348,43 @@ export function convertBytes(html, options) {
|
|
|
325
348
|
}
|
|
326
349
|
}
|
|
327
350
|
|
|
328
|
-
function _assertClass(instance, klass) {
|
|
329
|
-
if (!(instance instanceof klass)) {
|
|
330
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
351
|
/**
|
|
334
|
-
* @param {
|
|
335
|
-
* @
|
|
336
|
-
* @returns {string}
|
|
352
|
+
* @param {any} options
|
|
353
|
+
* @returns {WasmConversionOptionsHandle}
|
|
337
354
|
*/
|
|
338
|
-
export function
|
|
339
|
-
let deferred3_0;
|
|
340
|
-
let deferred3_1;
|
|
355
|
+
export function createConversionOptionsHandle(options) {
|
|
341
356
|
try {
|
|
342
357
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
343
|
-
|
|
344
|
-
const len0 = WASM_VECTOR_LEN;
|
|
345
|
-
_assertClass(handle, WasmConversionOptionsHandle);
|
|
346
|
-
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
358
|
+
wasm.createConversionOptionsHandle(retptr, addHeapObject(options));
|
|
347
359
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
348
360
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
349
361
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
var len2 = r1;
|
|
353
|
-
if (r3) {
|
|
354
|
-
ptr2 = 0; len2 = 0;
|
|
355
|
-
throw takeObject(r2);
|
|
362
|
+
if (r2) {
|
|
363
|
+
throw takeObject(r1);
|
|
356
364
|
}
|
|
357
|
-
|
|
358
|
-
deferred3_1 = len2;
|
|
359
|
-
return getStringFromWasm0(ptr2, len2);
|
|
365
|
+
return WasmConversionOptionsHandle.__wrap(r0);
|
|
360
366
|
} finally {
|
|
361
367
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
362
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
363
368
|
}
|
|
364
369
|
}
|
|
365
370
|
|
|
366
371
|
/**
|
|
367
|
-
* @param {
|
|
372
|
+
* @param {string} html
|
|
368
373
|
* @param {any} options
|
|
369
374
|
* @param {WasmInlineImageConfig | null} [image_config]
|
|
370
375
|
* @returns {WasmHtmlExtraction}
|
|
371
376
|
*/
|
|
372
|
-
export function
|
|
377
|
+
export function convertWithInlineImages(html, options, image_config) {
|
|
373
378
|
try {
|
|
374
379
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
375
|
-
|
|
380
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
381
|
+
const len0 = WASM_VECTOR_LEN;
|
|
382
|
+
let ptr1 = 0;
|
|
376
383
|
if (!isLikeNone(image_config)) {
|
|
377
384
|
_assertClass(image_config, WasmInlineImageConfig);
|
|
378
|
-
|
|
385
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
379
386
|
}
|
|
380
|
-
wasm.
|
|
387
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
381
388
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
382
389
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
383
390
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -391,60 +398,53 @@ export function convertBytesWithInlineImages(html, options, image_config) {
|
|
|
391
398
|
}
|
|
392
399
|
|
|
393
400
|
/**
|
|
394
|
-
* @param {
|
|
401
|
+
* @param {string} html
|
|
395
402
|
* @param {WasmConversionOptionsHandle} handle
|
|
396
403
|
* @returns {string}
|
|
397
404
|
*/
|
|
398
|
-
export function
|
|
399
|
-
let
|
|
400
|
-
let
|
|
405
|
+
export function convertWithOptionsHandle(html, handle) {
|
|
406
|
+
let deferred3_0;
|
|
407
|
+
let deferred3_1;
|
|
401
408
|
try {
|
|
402
409
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
410
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
411
|
+
const len0 = WASM_VECTOR_LEN;
|
|
403
412
|
_assertClass(handle, WasmConversionOptionsHandle);
|
|
404
|
-
wasm.
|
|
413
|
+
wasm.convertWithOptionsHandle(retptr, ptr0, len0, handle.__wbg_ptr);
|
|
405
414
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
406
415
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
407
416
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
408
417
|
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
409
|
-
var
|
|
410
|
-
var
|
|
418
|
+
var ptr2 = r0;
|
|
419
|
+
var len2 = r1;
|
|
411
420
|
if (r3) {
|
|
412
|
-
|
|
421
|
+
ptr2 = 0; len2 = 0;
|
|
413
422
|
throw takeObject(r2);
|
|
414
423
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
return getStringFromWasm0(
|
|
424
|
+
deferred3_0 = ptr2;
|
|
425
|
+
deferred3_1 = len2;
|
|
426
|
+
return getStringFromWasm0(ptr2, len2);
|
|
418
427
|
} finally {
|
|
419
428
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
420
|
-
wasm.__wbindgen_export4(
|
|
429
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
421
430
|
}
|
|
422
431
|
}
|
|
423
432
|
|
|
424
433
|
/**
|
|
425
|
-
*
|
|
426
|
-
*/
|
|
427
|
-
export function init() {
|
|
428
|
-
wasm.init();
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* @param {string} html
|
|
434
|
+
* @param {Uint8Array} html
|
|
433
435
|
* @param {any} options
|
|
434
436
|
* @param {WasmInlineImageConfig | null} [image_config]
|
|
435
437
|
* @returns {WasmHtmlExtraction}
|
|
436
438
|
*/
|
|
437
|
-
export function
|
|
439
|
+
export function convertBytesWithInlineImages(html, options, image_config) {
|
|
438
440
|
try {
|
|
439
441
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
440
|
-
|
|
441
|
-
const len0 = WASM_VECTOR_LEN;
|
|
442
|
-
let ptr1 = 0;
|
|
442
|
+
let ptr0 = 0;
|
|
443
443
|
if (!isLikeNone(image_config)) {
|
|
444
444
|
_assertClass(image_config, WasmInlineImageConfig);
|
|
445
|
-
|
|
445
|
+
ptr0 = image_config.__destroy_into_raw();
|
|
446
446
|
}
|
|
447
|
-
wasm.
|
|
447
|
+
wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
|
|
448
448
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
449
449
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
450
450
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
Binary file
|
package/dist-web/package.json
CHANGED
package/package.json
CHANGED