html-to-markdown-wasm 2.5.6 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,9 +7,12 @@ Powered by the same Rust engine as the Node.js, Python, and Ruby bindings, so Ma
7
7
  Runs anywhere: Node.js, Deno, Bun, browsers, and edge runtimes.
8
8
 
9
9
  [![Crates.io](https://img.shields.io/crates/v/html-to-markdown-rs.svg)](https://crates.io/crates/html-to-markdown-rs)
10
- [![npm version](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
11
- [![PyPI version](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
12
- [![Gem Version](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
10
+ [![npm (node)](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
11
+ [![npm (wasm)](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
12
+ [![npm (typescript)](https://badge.fury.io/js/html-to-markdown.svg)](https://www.npmjs.com/package/html-to-markdown)
13
+ [![PyPI](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
14
+ [![Packagist](https://img.shields.io/packagist/v/goldziher/html-to-markdown.svg)](https://packagist.org/packages/goldziher/html-to-markdown)
15
+ [![RubyGems](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
13
16
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
14
17
 
15
18
  ## Performance
package/dist/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # html-to-markdown
2
2
 
3
- High-performance HTML → Markdown conversion powered by Rust. Shipping as a Rust crate, Python package, Ruby gem, Node.js bindings, WebAssembly, and standalone CLI with identical rendering behaviour.
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
5
  [![Crates.io](https://img.shields.io/crates/v/html-to-markdown-rs.svg)](https://crates.io/crates/html-to-markdown-rs)
6
- [![npm version](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
7
- [![PyPI version](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
8
- [![Gem Version](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
9
- [![Python Versions](https://img.shields.io/pypi/pyversions/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
6
+ [![npm (node)](https://badge.fury.io/js/html-to-markdown-node.svg)](https://www.npmjs.com/package/html-to-markdown-node)
7
+ [![npm (wasm)](https://badge.fury.io/js/html-to-markdown-wasm.svg)](https://www.npmjs.com/package/html-to-markdown-wasm)
8
+ [![npm (typescript)](https://badge.fury.io/js/html-to-markdown.svg)](https://www.npmjs.com/package/html-to-markdown)
9
+ [![PyPI](https://badge.fury.io/py/html-to-markdown.svg)](https://pypi.org/project/html-to-markdown/)
10
+ [![Packagist](https://img.shields.io/packagist/v/goldziher/html-to-markdown.svg)](https://packagist.org/packages/goldziher/html-to-markdown)
11
+ [![RubyGems](https://badge.fury.io/rb/html-to-markdown.svg)](https://rubygems.org/gems/html-to-markdown)
10
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
11
13
  [![Discord](https://img.shields.io/badge/Discord-Join%20our%20community-7289da)](https://discord.gg/pXxagNK2zN)
12
14
 
@@ -33,7 +35,11 @@ Experience WebAssembly-powered HTML to Markdown conversion instantly in your bro
33
35
  - **JavaScript/TypeScript guides**:
34
36
  - Node.js/Bun (native) – [Node.js README](https://github.com/Goldziher/html-to-markdown/blob/main/crates/html-to-markdown-node/README.md)
35
37
  - WebAssembly (universal) – [WASM README](https://github.com/Goldziher/html-to-markdown/blob/main/crates/html-to-markdown-wasm/README.md)
36
- - **Python guide** – [Python README](https://github.com/Goldziher/html-to-markdown/blob/main/README_PYPI.md)
38
+ - TypeScript wrapper – [TypeScript README](https://github.com/Goldziher/html-to-markdown/blob/main/packages/typescript/README.md)
39
+ - **Python guide** – [Python README](https://github.com/Goldziher/html-to-markdown/blob/main/packages/python/README.md)
40
+ - **PHP guides**:
41
+ - PHP wrapper package – [PHP README](https://github.com/Goldziher/html-to-markdown/blob/main/packages/php/README.md)
42
+ - PHP extension (PIE) – [Extension README](https://github.com/Goldziher/html-to-markdown/blob/main/packages/php-ext/README.md)
37
43
  - **Ruby guide** – [Ruby README](https://github.com/Goldziher/html-to-markdown/blob/main/crates/html-to-markdown-rb/README.md)
38
44
  - **Rust guide** – [Rust README](https://github.com/Goldziher/html-to-markdown/blob/main/crates/html-to-markdown/README.md)
39
45
  - **Contributing** – [CONTRIBUTING.md](https://github.com/Goldziher/html-to-markdown/blob/main/CONTRIBUTING.md) ⭐ Start here!
@@ -47,6 +53,7 @@ Experience WebAssembly-powered HTML to Markdown conversion instantly in your bro
47
53
  | **WebAssembly** (universal) | `npm install html-to-markdown-wasm` |
48
54
  | **Deno** | `import { convert } from "npm:html-to-markdown-wasm"` |
49
55
  | **Python** (bindings + CLI) | `pip install html-to-markdown` |
56
+ | **PHP** (extension + helpers) | `pie install goldziher/html-to-markdown`<br>`composer require html-to-markdown/extension` |
50
57
  | **Ruby** gem | `bundle add html-to-markdown` or `gem install html-to-markdown` |
51
58
  | **Rust** crate | `cargo add html-to-markdown-rs` |
52
59
  | Rust CLI | `cargo install html-to-markdown-cli` |
@@ -171,7 +178,7 @@ Benchmarked on Apple M4 with complex real-world documents (Wikipedia articles, t
171
178
  ## Compatibility (v1 → v2)
172
179
 
173
180
  - V2’s Rust core sustains **150–210 MB/s** throughput; V1 averaged **≈ 2.5 MB/s** in its Python/BeautifulSoup implementation (60–80× faster).
174
- - The Python package offers a compatibility shim in `html_to_markdown.v1_compat` (`convert_to_markdown`, `convert_to_markdown_stream`, `markdownify`). Details and keyword mappings live in [Python README](https://github.com/Goldziher/html-to-markdown/blob/main/README_PYPI.md#v1-compatibility).
181
+ - The Python package offers a compatibility shim in `html_to_markdown.v1_compat` (`convert_to_markdown`, `convert_to_markdown_stream`, `markdownify`). Details and keyword mappings live in [Python README](https://github.com/Goldziher/html-to-markdown/blob/main/packages/python/README.md#v1-compatibility).
175
182
  - CLI flag changes, option renames, and other breaking updates are summarised in [CHANGELOG](https://github.com/Goldziher/html-to-markdown/blob/main/CHANGELOG.md#breaking-changes).
176
183
 
177
184
  ## Community
@@ -5,48 +5,48 @@
5
5
  */
6
6
  export function init(): void;
7
7
  /**
8
- * Convert HTML to Markdown
8
+ * Convert HTML to Markdown while collecting inline images
9
9
  *
10
10
  * # Arguments
11
11
  *
12
12
  * * `html` - The HTML string to convert
13
13
  * * `options` - Optional conversion options (as a JavaScript object)
14
+ * * `image_config` - Configuration for inline image extraction
14
15
  *
15
16
  * # Example
16
17
  *
17
18
  * ```javascript
18
- * import { convert } from '@html-to-markdown/wasm';
19
+ * import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
19
20
  *
20
- * const html = '<h1>Hello World</h1>';
21
- * const markdown = convert(html);
22
- * console.log(markdown); // # Hello World
21
+ * const html = '<img src="data:image/png;base64,..." alt="test">';
22
+ * const config = new WasmInlineImageConfig(1024 * 1024);
23
+ * config.inferDimensions = true;
24
+ *
25
+ * const result = convertWithInlineImages(html, null, config);
26
+ * console.log(result.markdown);
27
+ * console.log(result.inlineImages.length);
23
28
  * ```
24
29
  */
25
- export function convert(html: string, options: any): string;
30
+ export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
26
31
  /**
27
- * Convert HTML to Markdown while collecting inline images
32
+ * Convert HTML to Markdown
28
33
  *
29
34
  * # Arguments
30
35
  *
31
36
  * * `html` - The HTML string to convert
32
37
  * * `options` - Optional conversion options (as a JavaScript object)
33
- * * `image_config` - Configuration for inline image extraction
34
38
  *
35
39
  * # Example
36
40
  *
37
41
  * ```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;
42
+ * import { convert } from '@html-to-markdown/wasm';
43
43
  *
44
- * const result = convertWithInlineImages(html, null, config);
45
- * console.log(result.markdown);
46
- * console.log(result.inlineImages.length);
44
+ * const html = '<h1>Hello World</h1>';
45
+ * const markdown = convert(html);
46
+ * console.log(markdown); // # Hello World
47
47
  * ```
48
48
  */
49
- export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
49
+ export function convert(html: string, options: any): string;
50
50
  /**
51
51
  * Result of HTML extraction with inline images
52
52
  */
@@ -54,8 +54,8 @@ export class WasmHtmlExtraction {
54
54
  private constructor();
55
55
  free(): void;
56
56
  [Symbol.dispose](): void;
57
- readonly markdown: string;
58
57
  readonly inlineImages: WasmInlineImage[];
58
+ readonly markdown: string;
59
59
  readonly warnings: WasmInlineImageWarning[];
60
60
  }
61
61
  /**
@@ -65,13 +65,13 @@ export class WasmInlineImage {
65
65
  private constructor();
66
66
  free(): void;
67
67
  [Symbol.dispose](): void;
68
+ readonly attributes: any;
69
+ readonly dimensions: Uint32Array | undefined;
70
+ readonly description: string | undefined;
68
71
  readonly data: Uint8Array;
69
72
  readonly format: string;
70
- readonly filename: string | undefined;
71
- readonly description: string | undefined;
72
- readonly dimensions: Uint32Array | undefined;
73
73
  readonly source: string;
74
- readonly attributes: any;
74
+ readonly filename: string | undefined;
75
75
  }
76
76
  /**
77
77
  * Inline image configuration
@@ -80,8 +80,8 @@ export class WasmInlineImageConfig {
80
80
  free(): void;
81
81
  [Symbol.dispose](): void;
82
82
  constructor(max_decoded_size_bytes?: number | null);
83
- set filenamePrefix(value: string | null | undefined);
84
83
  set captureSvg(value: boolean);
84
+ set filenamePrefix(value: string | null | undefined);
85
85
  set inferDimensions(value: boolean);
86
86
  }
87
87
  /**
@@ -238,106 +238,106 @@ export function init() {
238
238
  wasm.init();
239
239
  }
240
240
 
241
+ function _assertClass(instance, klass) {
242
+ if (!(instance instanceof klass)) {
243
+ throw new Error(`expected instance of ${klass.name}`);
244
+ }
245
+ }
241
246
  /**
242
- * Convert HTML to Markdown
247
+ * Convert HTML to Markdown while collecting inline images
243
248
  *
244
249
  * # Arguments
245
250
  *
246
251
  * * `html` - The HTML string to convert
247
252
  * * `options` - Optional conversion options (as a JavaScript object)
253
+ * * `image_config` - Configuration for inline image extraction
248
254
  *
249
255
  * # Example
250
256
  *
251
257
  * ```javascript
252
- * import { convert } from '@html-to-markdown/wasm';
258
+ * import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
253
259
  *
254
- * const html = '<h1>Hello World</h1>';
255
- * const markdown = convert(html);
256
- * console.log(markdown); // # Hello World
260
+ * const html = '<img src="data:image/png;base64,..." alt="test">';
261
+ * const config = new WasmInlineImageConfig(1024 * 1024);
262
+ * config.inferDimensions = true;
263
+ *
264
+ * const result = convertWithInlineImages(html, null, config);
265
+ * console.log(result.markdown);
266
+ * console.log(result.inlineImages.length);
257
267
  * ```
258
268
  * @param {string} html
259
269
  * @param {any} options
260
- * @returns {string}
270
+ * @param {WasmInlineImageConfig | null} [image_config]
271
+ * @returns {WasmHtmlExtraction}
261
272
  */
262
- export function convert(html, options) {
263
- let deferred3_0;
264
- let deferred3_1;
273
+ export function convertWithInlineImages(html, options, image_config) {
265
274
  try {
266
275
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
267
276
  const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
268
277
  const len0 = WASM_VECTOR_LEN;
269
- wasm.convert(retptr, ptr0, len0, addHeapObject(options));
278
+ let ptr1 = 0;
279
+ if (!isLikeNone(image_config)) {
280
+ _assertClass(image_config, WasmInlineImageConfig);
281
+ ptr1 = image_config.__destroy_into_raw();
282
+ }
283
+ wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
270
284
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
271
285
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
272
286
  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);
287
+ if (r2) {
288
+ throw takeObject(r1);
279
289
  }
280
- deferred3_0 = ptr2;
281
- deferred3_1 = len2;
282
- return getStringFromWasm0(ptr2, len2);
290
+ return WasmHtmlExtraction.__wrap(r0);
283
291
  } finally {
284
292
  wasm.__wbindgen_add_to_stack_pointer(16);
285
- wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
286
293
  }
287
294
  }
288
295
 
289
- function _assertClass(instance, klass) {
290
- if (!(instance instanceof klass)) {
291
- throw new Error(`expected instance of ${klass.name}`);
292
- }
293
- }
294
296
  /**
295
- * Convert HTML to Markdown while collecting inline images
297
+ * Convert HTML to Markdown
296
298
  *
297
299
  * # Arguments
298
300
  *
299
301
  * * `html` - The HTML string to convert
300
302
  * * `options` - Optional conversion options (as a JavaScript object)
301
- * * `image_config` - Configuration for inline image extraction
302
303
  *
303
304
  * # Example
304
305
  *
305
306
  * ```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;
307
+ * import { convert } from '@html-to-markdown/wasm';
311
308
  *
312
- * const result = convertWithInlineImages(html, null, config);
313
- * console.log(result.markdown);
314
- * console.log(result.inlineImages.length);
309
+ * const html = '<h1>Hello World</h1>';
310
+ * const markdown = convert(html);
311
+ * console.log(markdown); // # Hello World
315
312
  * ```
316
313
  * @param {string} html
317
314
  * @param {any} options
318
- * @param {WasmInlineImageConfig | null} [image_config]
319
- * @returns {WasmHtmlExtraction}
315
+ * @returns {string}
320
316
  */
321
- export function convertWithInlineImages(html, options, image_config) {
317
+ export function convert(html, options) {
318
+ let deferred3_0;
319
+ let deferred3_1;
322
320
  try {
323
321
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
324
322
  const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
325
323
  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);
324
+ wasm.convert(retptr, ptr0, len0, addHeapObject(options));
332
325
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
333
326
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
334
327
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
335
- if (r2) {
336
- throw takeObject(r1);
328
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
329
+ var ptr2 = r0;
330
+ var len2 = r1;
331
+ if (r3) {
332
+ ptr2 = 0; len2 = 0;
333
+ throw takeObject(r2);
337
334
  }
338
- return WasmHtmlExtraction.__wrap(r0);
335
+ deferred3_0 = ptr2;
336
+ deferred3_1 = len2;
337
+ return getStringFromWasm0(ptr2, len2);
339
338
  } finally {
340
339
  wasm.__wbindgen_add_to_stack_pointer(16);
340
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
341
341
  }
342
342
  }
343
343
 
@@ -369,38 +369,38 @@ export class WasmHtmlExtraction {
369
369
  wasm.__wbg_wasmhtmlextraction_free(ptr, 0);
370
370
  }
371
371
  /**
372
- * @returns {string}
372
+ * @returns {WasmInlineImage[]}
373
373
  */
374
- get markdown() {
375
- let deferred1_0;
376
- let deferred1_1;
374
+ get inlineImages() {
377
375
  try {
378
376
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
379
- wasm.wasmhtmlextraction_markdown(retptr, this.__wbg_ptr);
377
+ wasm.wasmhtmlextraction_inlineImages(retptr, this.__wbg_ptr);
380
378
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
381
379
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
382
- deferred1_0 = r0;
383
- deferred1_1 = r1;
384
- return getStringFromWasm0(r0, r1);
380
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
381
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
382
+ return v1;
385
383
  } finally {
386
384
  wasm.__wbindgen_add_to_stack_pointer(16);
387
- wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
388
385
  }
389
386
  }
390
387
  /**
391
- * @returns {WasmInlineImage[]}
388
+ * @returns {string}
392
389
  */
393
- get inlineImages() {
390
+ get markdown() {
391
+ let deferred1_0;
392
+ let deferred1_1;
394
393
  try {
395
394
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
396
- wasm.wasmhtmlextraction_inlineImages(retptr, this.__wbg_ptr);
395
+ wasm.wasmhtmlextraction_markdown(retptr, this.__wbg_ptr);
397
396
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
398
397
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
399
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
400
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
401
- return v1;
398
+ deferred1_0 = r0;
399
+ deferred1_1 = r1;
400
+ return getStringFromWasm0(r0, r1);
402
401
  } finally {
403
402
  wasm.__wbindgen_add_to_stack_pointer(16);
403
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
404
404
  }
405
405
  }
406
406
  /**
@@ -450,44 +450,25 @@ export class WasmInlineImage {
450
450
  wasm.__wbg_wasminlineimage_free(ptr, 0);
451
451
  }
452
452
  /**
453
- * @returns {Uint8Array}
453
+ * @returns {any}
454
454
  */
455
- get data() {
456
- const ret = wasm.wasminlineimage_data(this.__wbg_ptr);
455
+ get attributes() {
456
+ const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
457
457
  return takeObject(ret);
458
458
  }
459
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_export4(deferred1_0, deferred1_1, 1);
476
- }
477
- }
478
- /**
479
- * @returns {string | undefined}
460
+ * @returns {Uint32Array | undefined}
480
461
  */
481
- get filename() {
462
+ get dimensions() {
482
463
  try {
483
464
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
484
- wasm.wasminlineimage_filename(retptr, this.__wbg_ptr);
465
+ wasm.wasminlineimage_dimensions(retptr, this.__wbg_ptr);
485
466
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
486
467
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
487
468
  let v1;
488
469
  if (r0 !== 0) {
489
- v1 = getStringFromWasm0(r0, r1).slice();
490
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
470
+ v1 = getArrayU32FromWasm0(r0, r1).slice();
471
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
491
472
  }
492
473
  return v1;
493
474
  } finally {
@@ -514,22 +495,29 @@ export class WasmInlineImage {
514
495
  }
515
496
  }
516
497
  /**
517
- * @returns {Uint32Array | undefined}
498
+ * @returns {Uint8Array}
518
499
  */
519
- get dimensions() {
500
+ get data() {
501
+ const ret = wasm.wasminlineimage_data(this.__wbg_ptr);
502
+ return takeObject(ret);
503
+ }
504
+ /**
505
+ * @returns {string}
506
+ */
507
+ get format() {
508
+ let deferred1_0;
509
+ let deferred1_1;
520
510
  try {
521
511
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
522
- wasm.wasminlineimage_dimensions(retptr, this.__wbg_ptr);
512
+ wasm.wasminlineimage_format(retptr, this.__wbg_ptr);
523
513
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
524
514
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
525
- let v1;
526
- if (r0 !== 0) {
527
- v1 = getArrayU32FromWasm0(r0, r1).slice();
528
- wasm.__wbindgen_export4(r0, r1 * 4, 4);
529
- }
530
- return v1;
515
+ deferred1_0 = r0;
516
+ deferred1_1 = r1;
517
+ return getStringFromWasm0(r0, r1);
531
518
  } finally {
532
519
  wasm.__wbindgen_add_to_stack_pointer(16);
520
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
533
521
  }
534
522
  }
535
523
  /**
@@ -552,11 +540,23 @@ export class WasmInlineImage {
552
540
  }
553
541
  }
554
542
  /**
555
- * @returns {any}
543
+ * @returns {string | undefined}
556
544
  */
557
- get attributes() {
558
- const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
559
- return takeObject(ret);
545
+ get filename() {
546
+ try {
547
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
548
+ wasm.wasminlineimage_filename(retptr, this.__wbg_ptr);
549
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
550
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
551
+ let v1;
552
+ if (r0 !== 0) {
553
+ v1 = getStringFromWasm0(r0, r1).slice();
554
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
555
+ }
556
+ return v1;
557
+ } finally {
558
+ wasm.__wbindgen_add_to_stack_pointer(16);
559
+ }
560
560
  }
561
561
  }
562
562
  if (Symbol.dispose) WasmInlineImage.prototype[Symbol.dispose] = WasmInlineImage.prototype.free;
@@ -581,13 +581,10 @@ export class WasmInlineImageConfig {
581
581
  wasm.__wbg_wasminlineimageconfig_free(ptr, 0);
582
582
  }
583
583
  /**
584
- * @param {number | null} [max_decoded_size_bytes]
584
+ * @param {boolean} capture
585
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;
586
+ set captureSvg(capture) {
587
+ wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
591
588
  }
592
589
  /**
593
590
  * @param {string | null} [prefix]
@@ -597,18 +594,21 @@ export class WasmInlineImageConfig {
597
594
  var len0 = WASM_VECTOR_LEN;
598
595
  wasm.wasminlineimageconfig_set_filenamePrefix(this.__wbg_ptr, ptr0, len0);
599
596
  }
600
- /**
601
- * @param {boolean} capture
602
- */
603
- set captureSvg(capture) {
604
- wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
605
- }
606
597
  /**
607
598
  * @param {boolean} infer
608
599
  */
609
600
  set inferDimensions(infer) {
610
601
  wasm.wasminlineimageconfig_set_inferDimensions(this.__wbg_ptr, infer);
611
602
  }
603
+ /**
604
+ * @param {number | null} [max_decoded_size_bytes]
605
+ */
606
+ constructor(max_decoded_size_bytes) {
607
+ const ret = wasm.wasminlineimageconfig_new(!isLikeNone(max_decoded_size_bytes), isLikeNone(max_decoded_size_bytes) ? 0 : max_decoded_size_bytes);
608
+ this.__wbg_ptr = ret >>> 0;
609
+ WasmInlineImageConfigFinalization.register(this, this.__wbg_ptr, this);
610
+ return this;
611
+ }
612
612
  }
613
613
  if (Symbol.dispose) WasmInlineImageConfig.prototype[Symbol.dispose] = WasmInlineImageConfig.prototype.free;
614
614
 
Binary file
@@ -1,28 +1,28 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
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;
4
+ export const __wbg_wasmhtmlextraction_free: (a: number, b: number) => void;
9
5
  export const __wbg_wasminlineimage_free: (a: number, b: number) => void;
6
+ export const __wbg_wasminlineimageconfig_free: (a: number, b: number) => void;
7
+ export const __wbg_wasminlineimagewarning_free: (a: number, b: number) => void;
8
+ export const convert: (a: number, b: number, c: number, d: number) => void;
9
+ export const convertWithInlineImages: (a: number, b: number, c: number, d: number, e: number) => void;
10
+ export const wasmhtmlextraction_inlineImages: (a: number, b: number) => void;
11
+ export const wasmhtmlextraction_markdown: (a: number, b: number) => void;
12
+ export const wasmhtmlextraction_warnings: (a: number, b: number) => void;
13
+ export const wasminlineimage_attributes: (a: number) => number;
10
14
  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
15
  export const wasminlineimage_description: (a: number, b: number) => void;
14
16
  export const wasminlineimage_dimensions: (a: number, b: number) => void;
17
+ export const wasminlineimage_filename: (a: number, b: number) => void;
18
+ export const wasminlineimage_format: (a: number, b: number) => void;
15
19
  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;
20
+ export const wasminlineimageconfig_new: (a: number, b: number) => number;
21
+ export const wasminlineimageconfig_set_captureSvg: (a: number, b: number) => void;
22
+ export const wasminlineimageconfig_set_filenamePrefix: (a: number, b: number, c: number) => void;
23
+ export const wasminlineimageconfig_set_inferDimensions: (a: number, b: number) => void;
18
24
  export const wasminlineimagewarning_index: (a: number) => number;
19
25
  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
26
  export const init: () => void;
27
27
  export const __wbindgen_export: (a: number, b: number) => number;
28
28
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
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.5.6",
7
+ "version": "2.6.2",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",