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 +6 -3
- package/dist/README.md +14 -7
- package/dist/html_to_markdown_wasm.d.ts +23 -23
- package/dist/html_to_markdown_wasm_bg.js +114 -114
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/html_to_markdown_wasm_bg.wasm.d.ts +15 -15
- package/dist/package.json +1 -1
- package/dist-node/README.md +203 -0
- package/dist-node/html_to_markdown_wasm.d.ts +96 -0
- package/dist-node/html_to_markdown_wasm.js +971 -0
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/html_to_markdown_wasm_bg.wasm.d.ts +32 -0
- package/dist-node/package.json +20 -0
- package/dist-web/README.md +203 -0
- package/dist-web/html_to_markdown_wasm.d.ts +152 -0
- package/dist-web/html_to_markdown_wasm.js +1015 -0
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/html_to_markdown_wasm_bg.wasm.d.ts +32 -0
- package/dist-web/package.json +24 -0
- package/package.json +38 -18
- package/LICENSE +0 -21
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
|
[](https://crates.io/crates/html-to-markdown-rs)
|
|
10
|
-
[](https://www.npmjs.com/package/html-to-markdown-node)
|
|
11
|
+
[](https://www.npmjs.com/package/html-to-markdown-wasm)
|
|
12
|
+
[](https://www.npmjs.com/package/html-to-markdown)
|
|
13
|
+
[](https://pypi.org/project/html-to-markdown/)
|
|
14
|
+
[](https://packagist.org/packages/goldziher/html-to-markdown)
|
|
15
|
+
[](https://rubygems.org/gems/html-to-markdown)
|
|
13
16
|
[](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
|
[](https://crates.io/crates/html-to-markdown-rs)
|
|
6
|
-
[](https://www.npmjs.com/package/html-to-markdown-node)
|
|
7
|
+
[](https://www.npmjs.com/package/html-to-markdown-wasm)
|
|
8
|
+
[](https://www.npmjs.com/package/html-to-markdown)
|
|
9
|
+
[](https://pypi.org/project/html-to-markdown/)
|
|
10
|
+
[](https://packagist.org/packages/goldziher/html-to-markdown)
|
|
11
|
+
[](https://rubygems.org/gems/html-to-markdown)
|
|
10
12
|
[](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
|
|
11
13
|
[](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
|
-
-
|
|
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/
|
|
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 {
|
|
19
|
+
* import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
|
|
19
20
|
*
|
|
20
|
-
* const html = '<
|
|
21
|
-
* const
|
|
22
|
-
*
|
|
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
|
|
30
|
+
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
26
31
|
/**
|
|
27
|
-
* Convert HTML to Markdown
|
|
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 {
|
|
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
|
|
45
|
-
*
|
|
46
|
-
* console.log(
|
|
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
|
|
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
|
|
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 {
|
|
258
|
+
* import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
|
|
253
259
|
*
|
|
254
|
-
* const html = '<
|
|
255
|
-
* const
|
|
256
|
-
*
|
|
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
|
-
* @
|
|
270
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
271
|
+
* @returns {WasmHtmlExtraction}
|
|
261
272
|
*/
|
|
262
|
-
export function
|
|
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
|
-
|
|
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
|
-
|
|
274
|
-
|
|
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
|
-
|
|
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
|
|
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 {
|
|
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
|
|
313
|
-
*
|
|
314
|
-
* console.log(
|
|
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
|
-
* @
|
|
319
|
-
* @returns {WasmHtmlExtraction}
|
|
315
|
+
* @returns {string}
|
|
320
316
|
*/
|
|
321
|
-
export function
|
|
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
|
-
|
|
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
|
-
|
|
336
|
-
|
|
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
|
-
|
|
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 {
|
|
372
|
+
* @returns {WasmInlineImage[]}
|
|
373
373
|
*/
|
|
374
|
-
get
|
|
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.
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
return
|
|
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 {
|
|
388
|
+
* @returns {string}
|
|
392
389
|
*/
|
|
393
|
-
get
|
|
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.
|
|
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
|
-
|
|
400
|
-
|
|
401
|
-
return
|
|
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 {
|
|
453
|
+
* @returns {any}
|
|
454
454
|
*/
|
|
455
|
-
get
|
|
456
|
-
const ret = wasm.
|
|
455
|
+
get attributes() {
|
|
456
|
+
const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
|
|
457
457
|
return takeObject(ret);
|
|
458
458
|
}
|
|
459
459
|
/**
|
|
460
|
-
* @returns {
|
|
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
|
|
462
|
+
get dimensions() {
|
|
482
463
|
try {
|
|
483
464
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
484
|
-
wasm.
|
|
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 =
|
|
490
|
-
wasm.__wbindgen_export4(r0, r1 *
|
|
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 {
|
|
498
|
+
* @returns {Uint8Array}
|
|
518
499
|
*/
|
|
519
|
-
get
|
|
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.
|
|
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
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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 {
|
|
543
|
+
* @returns {string | undefined}
|
|
556
544
|
*/
|
|
557
|
-
get
|
|
558
|
-
|
|
559
|
-
|
|
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 {
|
|
584
|
+
* @param {boolean} capture
|
|
585
585
|
*/
|
|
586
|
-
|
|
587
|
-
|
|
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
|
|
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
|
|
17
|
-
export const
|
|
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;
|