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 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
- [![Crates.io](https://img.shields.io/crates/v/html-to-markdown-rs.svg)](https://crates.io/crates/html-to-markdown-rs)
12
+ [![Crates.io](https://img.shields.io/crates/v/html-to-markdown.svg)](https://crates.io/crates/html-to-markdown)
13
13
  [![npm (node)](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
14
14
  [![npm (wasm)](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
15
15
  [![PyPI](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
16
16
  [![Packagist](https://img.shields.io/packagist/v/goldziher/html-to-markdown.svg)](https://packagist.org/packages/goldziher/html-to-markdown)
17
17
  [![RubyGems](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
18
+ [![NuGet](https://img.shields.io/nuget/v/HtmlToMarkdown.svg)](https://www.nuget.org/packages/HtmlToMarkdown/)
19
+ [![Maven Central](https://img.shields.io/maven-central/v/io.github.goldziher/html-to-markdown.svg)](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
20
+ [![Go Reference](https://pkg.go.dev/badge/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown.svg)](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
18
21
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- [![Crates.io](https://img.shields.io/crates/v/html-to-markdown-rs.svg)](https://crates.io/crates/html-to-markdown-rs)
5
+ [![Crates.io](https://img.shields.io/crates/v/html-to-markdown.svg)](https://crates.io/crates/html-to-markdown)
6
6
  [![npm (node)](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
7
7
  [![npm (wasm)](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
8
8
  [![PyPI](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
9
9
  [![Packagist](https://img.shields.io/packagist/v/goldziher/html-to-markdown.svg)](https://packagist.org/packages/goldziher/html-to-markdown)
10
10
  [![RubyGems](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
11
+ [![NuGet](https://img.shields.io/nuget/v/HtmlToMarkdown.svg)](https://www.nuget.org/packages/HtmlToMarkdown/)
12
+ [![Maven Central](https://img.shields.io/maven-central/v/io.github.goldziher/html-to-markdown.svg)](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
13
+ [![Go Reference](https://pkg.go.dev/badge/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown.svg)](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
11
14
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
12
15
  [![Discord](https://img.shields.io/badge/Discord-Join%20our%20community-7289da)](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 (≈150MB/s) on the 129KB Wikipedia Lists page thanks to the new Buffer/Uint8Array fast paths and release-mode harness. Ruby stays close at ~1.2k ops/sec, PHP lands around 0.3k ops/sec (≈35 MB/s), and WASM hits ~0.85k ops/sec—plenty for browsers, Deno, and edge runtimes.
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
- export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
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 {WasmConversionOptionsHandle}
244
+ * @returns {string}
237
245
  */
238
- export function createConversionOptionsHandle(options) {
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.createConversionOptionsHandle(retptr, addHeapObject(options));
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
- if (r2) {
246
- throw takeObject(r1);
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
- return WasmConversionOptionsHandle.__wrap(r0);
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 {any} options
326
+ * @param {WasmConversionOptionsHandle} handle
305
327
  * @returns {string}
306
328
  */
307
- export function convertBytes(html, options) {
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
- wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
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 {string} html
339
- * @param {WasmConversionOptionsHandle} handle
340
- * @returns {string}
356
+ * @param {any} options
357
+ * @returns {WasmConversionOptionsHandle}
341
358
  */
342
- export function convertWithOptionsHandle(html, handle) {
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
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
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
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
355
- var ptr2 = r0;
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
- deferred3_0 = ptr2;
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 {Uint8Array} html
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 convertBytesWithInlineImages(html, options, image_config) {
381
+ export function convertWithInlineImages(html, options, image_config) {
377
382
  try {
378
383
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
379
- let ptr0 = 0;
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
- ptr0 = image_config.__destroy_into_raw();
389
+ ptr1 = image_config.__destroy_into_raw();
383
390
  }
384
- wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
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 {Uint8Array} html
405
+ * @param {string} html
399
406
  * @param {WasmConversionOptionsHandle} handle
400
407
  * @returns {string}
401
408
  */
402
- export function convertBytesWithOptionsHandle(html, handle) {
403
- let deferred2_0;
404
- let deferred2_1;
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.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
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 ptr1 = r0;
414
- var len1 = r1;
422
+ var ptr2 = r0;
423
+ var len2 = r1;
415
424
  if (r3) {
416
- ptr1 = 0; len1 = 0;
425
+ ptr2 = 0; len2 = 0;
417
426
  throw takeObject(r2);
418
427
  }
419
- deferred2_0 = ptr1;
420
- deferred2_1 = len1;
421
- return getStringFromWasm0(ptr1, len1);
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(deferred2_0, deferred2_1, 1);
433
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
425
434
  }
426
435
  }
427
436
 
428
437
  /**
429
- * Initialize panic hook for better error messages in the browser
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 convertWithInlineImages(html, options, image_config) {
443
+ export function convertBytesWithInlineImages(html, options, image_config) {
442
444
  try {
443
445
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
444
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
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
- ptr1 = image_config.__destroy_into_raw();
449
+ ptr0 = image_config.__destroy_into_raw();
450
450
  }
451
- wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
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
@@ -4,7 +4,7 @@
4
4
  "collaborators": [
5
5
  "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
6
6
  ],
7
- "version": "2.7.2",
7
+ "version": "2.8.1",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
@@ -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
- [![Crates.io](https://img.shields.io/crates/v/html-to-markdown-rs.svg)](https://crates.io/crates/html-to-markdown-rs)
5
+ [![Crates.io](https://img.shields.io/crates/v/html-to-markdown.svg)](https://crates.io/crates/html-to-markdown)
6
6
  [![npm (node)](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
7
7
  [![npm (wasm)](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
8
8
  [![PyPI](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
9
9
  [![Packagist](https://img.shields.io/packagist/v/goldziher/html-to-markdown.svg)](https://packagist.org/packages/goldziher/html-to-markdown)
10
10
  [![RubyGems](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
11
+ [![NuGet](https://img.shields.io/nuget/v/HtmlToMarkdown.svg)](https://www.nuget.org/packages/HtmlToMarkdown/)
12
+ [![Maven Central](https://img.shields.io/maven-central/v/io.github.goldziher/html-to-markdown.svg)](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
13
+ [![Go Reference](https://pkg.go.dev/badge/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown.svg)](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
11
14
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
12
15
  [![Discord](https://img.shields.io/badge/Discord-Join%20our%20community-7289da)](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 (≈150MB/s) on the 129KB Wikipedia Lists page thanks to the new Buffer/Uint8Array fast paths and release-mode harness. Ruby stays close at ~1.2k ops/sec, PHP lands around 0.3k ops/sec (≈35 MB/s), and WASM hits ~0.85k ops/sec—plenty for browsers, Deno, and edge runtimes.
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
- export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
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 {WasmConversionOptionsHandle}
234
+ * @returns {string}
227
235
  */
228
- exports.createConversionOptionsHandle = function(options) {
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.createConversionOptionsHandle(retptr, addHeapObject(options));
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
- if (r2) {
236
- throw takeObject(r1);
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
- return WasmConversionOptionsHandle.__wrap(r0);
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 {any} options
316
+ * @param {WasmConversionOptionsHandle} handle
295
317
  * @returns {string}
296
318
  */
297
- exports.convertBytes = function(html, options) {
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
- wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
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 {string} html
329
- * @param {WasmConversionOptionsHandle} handle
330
- * @returns {string}
346
+ * @param {any} options
347
+ * @returns {WasmConversionOptionsHandle}
331
348
  */
332
- exports.convertWithOptionsHandle = function(html, handle) {
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
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
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
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
345
- var ptr2 = r0;
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
- deferred3_0 = ptr2;
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 {Uint8Array} html
366
+ * @param {string} html
362
367
  * @param {any} options
363
368
  * @param {WasmInlineImageConfig | null} [image_config]
364
369
  * @returns {WasmHtmlExtraction}
365
370
  */
366
- exports.convertBytesWithInlineImages = function(html, options, image_config) {
371
+ exports.convertWithInlineImages = function(html, options, image_config) {
367
372
  try {
368
373
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
369
- let ptr0 = 0;
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
- ptr0 = image_config.__destroy_into_raw();
379
+ ptr1 = image_config.__destroy_into_raw();
373
380
  }
374
- wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
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 {Uint8Array} html
395
+ * @param {string} html
389
396
  * @param {WasmConversionOptionsHandle} handle
390
397
  * @returns {string}
391
398
  */
392
- exports.convertBytesWithOptionsHandle = function(html, handle) {
393
- let deferred2_0;
394
- let deferred2_1;
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.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
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 ptr1 = r0;
404
- var len1 = r1;
412
+ var ptr2 = r0;
413
+ var len2 = r1;
405
414
  if (r3) {
406
- ptr1 = 0; len1 = 0;
415
+ ptr2 = 0; len2 = 0;
407
416
  throw takeObject(r2);
408
417
  }
409
- deferred2_0 = ptr1;
410
- deferred2_1 = len1;
411
- return getStringFromWasm0(ptr1, len1);
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(deferred2_0, deferred2_1, 1);
423
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
415
424
  }
416
425
  };
417
426
 
418
427
  /**
419
- * Initialize panic hook for better error messages in the browser
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.convertWithInlineImages = function(html, options, image_config) {
433
+ exports.convertBytesWithInlineImages = function(html, options, image_config) {
432
434
  try {
433
435
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
434
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
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
- ptr1 = image_config.__destroy_into_raw();
439
+ ptr0 = image_config.__destroy_into_raw();
440
440
  }
441
- wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
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);
@@ -3,7 +3,7 @@
3
3
  "collaborators": [
4
4
  "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
5
5
  ],
6
- "version": "2.7.2",
6
+ "version": "2.8.1",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
@@ -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
- [![Crates.io](https://img.shields.io/crates/v/html-to-markdown-rs.svg)](https://crates.io/crates/html-to-markdown-rs)
5
+ [![Crates.io](https://img.shields.io/crates/v/html-to-markdown.svg)](https://crates.io/crates/html-to-markdown)
6
6
  [![npm (node)](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
7
7
  [![npm (wasm)](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
8
8
  [![PyPI](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
9
9
  [![Packagist](https://img.shields.io/packagist/v/goldziher/html-to-markdown.svg)](https://packagist.org/packages/goldziher/html-to-markdown)
10
10
  [![RubyGems](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
11
+ [![NuGet](https://img.shields.io/nuget/v/HtmlToMarkdown.svg)](https://www.nuget.org/packages/HtmlToMarkdown/)
12
+ [![Maven Central](https://img.shields.io/maven-central/v/io.github.goldziher/html-to-markdown.svg)](https://central.sonatype.com/artifact/io.github.goldziher/html-to-markdown)
13
+ [![Go Reference](https://pkg.go.dev/badge/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown.svg)](https://pkg.go.dev/github.com/Goldziher/html-to-markdown/packages/go/htmltomarkdown)
11
14
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
12
15
  [![Discord](https://img.shields.io/badge/Discord-Join%20our%20community-7289da)](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 (≈150MB/s) on the 129KB Wikipedia Lists page thanks to the new Buffer/Uint8Array fast paths and release-mode harness. Ruby stays close at ~1.2k ops/sec, PHP lands around 0.3k ops/sec (≈35 MB/s), and WASM hits ~0.85k ops/sec—plenty for browsers, Deno, and edge runtimes.
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
- export function createConversionOptionsHandle(options: any): WasmConversionOptionsHandle;
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 {WasmConversionOptionsHandle}
240
+ * @returns {string}
233
241
  */
234
- export function createConversionOptionsHandle(options) {
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.createConversionOptionsHandle(retptr, addHeapObject(options));
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
- if (r2) {
242
- throw takeObject(r1);
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
- return WasmConversionOptionsHandle.__wrap(r0);
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 {any} options
322
+ * @param {WasmConversionOptionsHandle} handle
301
323
  * @returns {string}
302
324
  */
303
- export function convertBytes(html, options) {
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
- wasm.convertBytes(retptr, addHeapObject(html), addHeapObject(options));
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 {string} html
335
- * @param {WasmConversionOptionsHandle} handle
336
- * @returns {string}
352
+ * @param {any} options
353
+ * @returns {WasmConversionOptionsHandle}
337
354
  */
338
- export function convertWithOptionsHandle(html, handle) {
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
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
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
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
351
- var ptr2 = r0;
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
- deferred3_0 = ptr2;
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 {Uint8Array} html
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 convertBytesWithInlineImages(html, options, image_config) {
377
+ export function convertWithInlineImages(html, options, image_config) {
373
378
  try {
374
379
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
375
- let ptr0 = 0;
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
- ptr0 = image_config.__destroy_into_raw();
385
+ ptr1 = image_config.__destroy_into_raw();
379
386
  }
380
- wasm.convertBytesWithInlineImages(retptr, addHeapObject(html), addHeapObject(options), ptr0);
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 {Uint8Array} html
401
+ * @param {string} html
395
402
  * @param {WasmConversionOptionsHandle} handle
396
403
  * @returns {string}
397
404
  */
398
- export function convertBytesWithOptionsHandle(html, handle) {
399
- let deferred2_0;
400
- let deferred2_1;
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.convertBytesWithOptionsHandle(retptr, addHeapObject(html), handle.__wbg_ptr);
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 ptr1 = r0;
410
- var len1 = r1;
418
+ var ptr2 = r0;
419
+ var len2 = r1;
411
420
  if (r3) {
412
- ptr1 = 0; len1 = 0;
421
+ ptr2 = 0; len2 = 0;
413
422
  throw takeObject(r2);
414
423
  }
415
- deferred2_0 = ptr1;
416
- deferred2_1 = len1;
417
- return getStringFromWasm0(ptr1, len1);
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(deferred2_0, deferred2_1, 1);
429
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
421
430
  }
422
431
  }
423
432
 
424
433
  /**
425
- * Initialize panic hook for better error messages in the browser
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 convertWithInlineImages(html, options, image_config) {
439
+ export function convertBytesWithInlineImages(html, options, image_config) {
438
440
  try {
439
441
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
440
- const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
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
- ptr1 = image_config.__destroy_into_raw();
445
+ ptr0 = image_config.__destroy_into_raw();
446
446
  }
447
- wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
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);
@@ -4,7 +4,7 @@
4
4
  "collaborators": [
5
5
  "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
6
6
  ],
7
- "version": "2.7.2",
7
+ "version": "2.8.1",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-to-markdown-wasm",
3
- "version": "2.7.2",
3
+ "version": "2.8.1",
4
4
  "description": "High-performance HTML to Markdown converter - WebAssembly bindings",
5
5
  "main": "dist/html_to_markdown_wasm.js",
6
6
  "types": "dist/html_to_markdown_wasm.d.ts",