html-to-markdown-wasm 2.5.6 → 2.6.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 +6 -3
- package/dist/README.md +14 -7
- package/dist/html_to_markdown_wasm.d.ts +27 -27
- package/dist/html_to_markdown_wasm_bg.js +121 -120
- 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 +972 -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 +1016 -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
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export function init(): void;
|
|
7
|
-
/**
|
|
8
|
-
* Convert HTML to Markdown
|
|
4
|
+
* Convert HTML to Markdown while collecting inline images
|
|
9
5
|
*
|
|
10
6
|
* # Arguments
|
|
11
7
|
*
|
|
12
8
|
* * `html` - The HTML string to convert
|
|
13
9
|
* * `options` - Optional conversion options (as a JavaScript object)
|
|
10
|
+
* * `image_config` - Configuration for inline image extraction
|
|
14
11
|
*
|
|
15
12
|
* # Example
|
|
16
13
|
*
|
|
17
14
|
* ```javascript
|
|
18
|
-
* import {
|
|
15
|
+
* import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
|
|
19
16
|
*
|
|
20
|
-
* const html = '<
|
|
21
|
-
* const
|
|
22
|
-
*
|
|
17
|
+
* const html = '<img src="data:image/png;base64,..." alt="test">';
|
|
18
|
+
* const config = new WasmInlineImageConfig(1024 * 1024);
|
|
19
|
+
* config.inferDimensions = true;
|
|
20
|
+
*
|
|
21
|
+
* const result = convertWithInlineImages(html, null, config);
|
|
22
|
+
* console.log(result.markdown);
|
|
23
|
+
* console.log(result.inlineImages.length);
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
|
-
export function
|
|
26
|
+
export function convertWithInlineImages(html: string, options: any, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
26
27
|
/**
|
|
27
|
-
* Convert HTML to Markdown
|
|
28
|
+
* Convert HTML to Markdown
|
|
28
29
|
*
|
|
29
30
|
* # Arguments
|
|
30
31
|
*
|
|
31
32
|
* * `html` - The HTML string to convert
|
|
32
33
|
* * `options` - Optional conversion options (as a JavaScript object)
|
|
33
|
-
* * `image_config` - Configuration for inline image extraction
|
|
34
34
|
*
|
|
35
35
|
* # Example
|
|
36
36
|
*
|
|
37
37
|
* ```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;
|
|
38
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
43
39
|
*
|
|
44
|
-
* const
|
|
45
|
-
*
|
|
46
|
-
* console.log(
|
|
40
|
+
* const html = '<h1>Hello World</h1>';
|
|
41
|
+
* const markdown = convert(html);
|
|
42
|
+
* console.log(markdown); // # Hello World
|
|
47
43
|
* ```
|
|
48
44
|
*/
|
|
49
|
-
export function
|
|
45
|
+
export function convert(html: string, options: any): string;
|
|
46
|
+
/**
|
|
47
|
+
* Initialize panic hook for better error messages in the browser
|
|
48
|
+
*/
|
|
49
|
+
export function init(): void;
|
|
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
|
/**
|
|
@@ -231,116 +231,117 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
231
231
|
}
|
|
232
232
|
return result;
|
|
233
233
|
}
|
|
234
|
-
/**
|
|
235
|
-
* Initialize panic hook for better error messages in the browser
|
|
236
|
-
*/
|
|
237
|
-
export function init() {
|
|
238
|
-
wasm.init();
|
|
239
|
-
}
|
|
240
234
|
|
|
235
|
+
function _assertClass(instance, klass) {
|
|
236
|
+
if (!(instance instanceof klass)) {
|
|
237
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
241
240
|
/**
|
|
242
|
-
* Convert HTML to Markdown
|
|
241
|
+
* Convert HTML to Markdown while collecting inline images
|
|
243
242
|
*
|
|
244
243
|
* # Arguments
|
|
245
244
|
*
|
|
246
245
|
* * `html` - The HTML string to convert
|
|
247
246
|
* * `options` - Optional conversion options (as a JavaScript object)
|
|
247
|
+
* * `image_config` - Configuration for inline image extraction
|
|
248
248
|
*
|
|
249
249
|
* # Example
|
|
250
250
|
*
|
|
251
251
|
* ```javascript
|
|
252
|
-
* import {
|
|
252
|
+
* import { convertWithInlineImages, WasmInlineImageConfig } from '@html-to-markdown/wasm';
|
|
253
253
|
*
|
|
254
|
-
* const html = '<
|
|
255
|
-
* const
|
|
256
|
-
*
|
|
254
|
+
* const html = '<img src="data:image/png;base64,..." alt="test">';
|
|
255
|
+
* const config = new WasmInlineImageConfig(1024 * 1024);
|
|
256
|
+
* config.inferDimensions = true;
|
|
257
|
+
*
|
|
258
|
+
* const result = convertWithInlineImages(html, null, config);
|
|
259
|
+
* console.log(result.markdown);
|
|
260
|
+
* console.log(result.inlineImages.length);
|
|
257
261
|
* ```
|
|
258
262
|
* @param {string} html
|
|
259
263
|
* @param {any} options
|
|
260
|
-
* @
|
|
264
|
+
* @param {WasmInlineImageConfig | null} [image_config]
|
|
265
|
+
* @returns {WasmHtmlExtraction}
|
|
261
266
|
*/
|
|
262
|
-
export function
|
|
263
|
-
let deferred3_0;
|
|
264
|
-
let deferred3_1;
|
|
267
|
+
export function convertWithInlineImages(html, options, image_config) {
|
|
265
268
|
try {
|
|
266
269
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
267
270
|
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
268
271
|
const len0 = WASM_VECTOR_LEN;
|
|
269
|
-
|
|
272
|
+
let ptr1 = 0;
|
|
273
|
+
if (!isLikeNone(image_config)) {
|
|
274
|
+
_assertClass(image_config, WasmInlineImageConfig);
|
|
275
|
+
ptr1 = image_config.__destroy_into_raw();
|
|
276
|
+
}
|
|
277
|
+
wasm.convertWithInlineImages(retptr, ptr0, len0, addHeapObject(options), ptr1);
|
|
270
278
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
271
279
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
272
280
|
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);
|
|
281
|
+
if (r2) {
|
|
282
|
+
throw takeObject(r1);
|
|
279
283
|
}
|
|
280
|
-
|
|
281
|
-
deferred3_1 = len2;
|
|
282
|
-
return getStringFromWasm0(ptr2, len2);
|
|
284
|
+
return WasmHtmlExtraction.__wrap(r0);
|
|
283
285
|
} finally {
|
|
284
286
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
285
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
|
|
289
|
-
function _assertClass(instance, klass) {
|
|
290
|
-
if (!(instance instanceof klass)) {
|
|
291
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
290
|
/**
|
|
295
|
-
* Convert HTML to Markdown
|
|
291
|
+
* Convert HTML to Markdown
|
|
296
292
|
*
|
|
297
293
|
* # Arguments
|
|
298
294
|
*
|
|
299
295
|
* * `html` - The HTML string to convert
|
|
300
296
|
* * `options` - Optional conversion options (as a JavaScript object)
|
|
301
|
-
* * `image_config` - Configuration for inline image extraction
|
|
302
297
|
*
|
|
303
298
|
* # Example
|
|
304
299
|
*
|
|
305
300
|
* ```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;
|
|
301
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
311
302
|
*
|
|
312
|
-
* const
|
|
313
|
-
*
|
|
314
|
-
* console.log(
|
|
303
|
+
* const html = '<h1>Hello World</h1>';
|
|
304
|
+
* const markdown = convert(html);
|
|
305
|
+
* console.log(markdown); // # Hello World
|
|
315
306
|
* ```
|
|
316
307
|
* @param {string} html
|
|
317
308
|
* @param {any} options
|
|
318
|
-
* @
|
|
319
|
-
* @returns {WasmHtmlExtraction}
|
|
309
|
+
* @returns {string}
|
|
320
310
|
*/
|
|
321
|
-
export function
|
|
311
|
+
export function convert(html, options) {
|
|
312
|
+
let deferred3_0;
|
|
313
|
+
let deferred3_1;
|
|
322
314
|
try {
|
|
323
315
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
324
316
|
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
325
317
|
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);
|
|
318
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
332
319
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
333
320
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
334
321
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
335
|
-
|
|
336
|
-
|
|
322
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
323
|
+
var ptr2 = r0;
|
|
324
|
+
var len2 = r1;
|
|
325
|
+
if (r3) {
|
|
326
|
+
ptr2 = 0; len2 = 0;
|
|
327
|
+
throw takeObject(r2);
|
|
337
328
|
}
|
|
338
|
-
|
|
329
|
+
deferred3_0 = ptr2;
|
|
330
|
+
deferred3_1 = len2;
|
|
331
|
+
return getStringFromWasm0(ptr2, len2);
|
|
339
332
|
} finally {
|
|
340
333
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
334
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
341
335
|
}
|
|
342
336
|
}
|
|
343
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Initialize panic hook for better error messages in the browser
|
|
340
|
+
*/
|
|
341
|
+
export function init() {
|
|
342
|
+
wasm.init();
|
|
343
|
+
}
|
|
344
|
+
|
|
344
345
|
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
345
346
|
? { register: () => {}, unregister: () => {} }
|
|
346
347
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
@@ -369,38 +370,38 @@ export class WasmHtmlExtraction {
|
|
|
369
370
|
wasm.__wbg_wasmhtmlextraction_free(ptr, 0);
|
|
370
371
|
}
|
|
371
372
|
/**
|
|
372
|
-
* @returns {
|
|
373
|
+
* @returns {WasmInlineImage[]}
|
|
373
374
|
*/
|
|
374
|
-
get
|
|
375
|
-
let deferred1_0;
|
|
376
|
-
let deferred1_1;
|
|
375
|
+
get inlineImages() {
|
|
377
376
|
try {
|
|
378
377
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
-
wasm.
|
|
378
|
+
wasm.wasmhtmlextraction_inlineImages(retptr, this.__wbg_ptr);
|
|
380
379
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
381
380
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
return
|
|
381
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
382
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
383
|
+
return v1;
|
|
385
384
|
} finally {
|
|
386
385
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
387
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
388
386
|
}
|
|
389
387
|
}
|
|
390
388
|
/**
|
|
391
|
-
* @returns {
|
|
389
|
+
* @returns {string}
|
|
392
390
|
*/
|
|
393
|
-
get
|
|
391
|
+
get markdown() {
|
|
392
|
+
let deferred1_0;
|
|
393
|
+
let deferred1_1;
|
|
394
394
|
try {
|
|
395
395
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
396
|
-
wasm.
|
|
396
|
+
wasm.wasmhtmlextraction_markdown(retptr, this.__wbg_ptr);
|
|
397
397
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
398
398
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
return
|
|
399
|
+
deferred1_0 = r0;
|
|
400
|
+
deferred1_1 = r1;
|
|
401
|
+
return getStringFromWasm0(r0, r1);
|
|
402
402
|
} finally {
|
|
403
403
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
404
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
404
405
|
}
|
|
405
406
|
}
|
|
406
407
|
/**
|
|
@@ -450,44 +451,25 @@ export class WasmInlineImage {
|
|
|
450
451
|
wasm.__wbg_wasminlineimage_free(ptr, 0);
|
|
451
452
|
}
|
|
452
453
|
/**
|
|
453
|
-
* @returns {
|
|
454
|
+
* @returns {any}
|
|
454
455
|
*/
|
|
455
|
-
get
|
|
456
|
-
const ret = wasm.
|
|
456
|
+
get attributes() {
|
|
457
|
+
const ret = wasm.wasminlineimage_attributes(this.__wbg_ptr);
|
|
457
458
|
return takeObject(ret);
|
|
458
459
|
}
|
|
459
460
|
/**
|
|
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}
|
|
461
|
+
* @returns {Uint32Array | undefined}
|
|
480
462
|
*/
|
|
481
|
-
get
|
|
463
|
+
get dimensions() {
|
|
482
464
|
try {
|
|
483
465
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
484
|
-
wasm.
|
|
466
|
+
wasm.wasminlineimage_dimensions(retptr, this.__wbg_ptr);
|
|
485
467
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
486
468
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
487
469
|
let v1;
|
|
488
470
|
if (r0 !== 0) {
|
|
489
|
-
v1 =
|
|
490
|
-
wasm.__wbindgen_export4(r0, r1 *
|
|
471
|
+
v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
472
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
491
473
|
}
|
|
492
474
|
return v1;
|
|
493
475
|
} finally {
|
|
@@ -514,22 +496,29 @@ export class WasmInlineImage {
|
|
|
514
496
|
}
|
|
515
497
|
}
|
|
516
498
|
/**
|
|
517
|
-
* @returns {
|
|
499
|
+
* @returns {Uint8Array}
|
|
518
500
|
*/
|
|
519
|
-
get
|
|
501
|
+
get data() {
|
|
502
|
+
const ret = wasm.wasminlineimage_data(this.__wbg_ptr);
|
|
503
|
+
return takeObject(ret);
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* @returns {string}
|
|
507
|
+
*/
|
|
508
|
+
get format() {
|
|
509
|
+
let deferred1_0;
|
|
510
|
+
let deferred1_1;
|
|
520
511
|
try {
|
|
521
512
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
522
|
-
wasm.
|
|
513
|
+
wasm.wasminlineimage_format(retptr, this.__wbg_ptr);
|
|
523
514
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
524
515
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
529
|
-
}
|
|
530
|
-
return v1;
|
|
516
|
+
deferred1_0 = r0;
|
|
517
|
+
deferred1_1 = r1;
|
|
518
|
+
return getStringFromWasm0(r0, r1);
|
|
531
519
|
} finally {
|
|
532
520
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
521
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
533
522
|
}
|
|
534
523
|
}
|
|
535
524
|
/**
|
|
@@ -552,11 +541,23 @@ export class WasmInlineImage {
|
|
|
552
541
|
}
|
|
553
542
|
}
|
|
554
543
|
/**
|
|
555
|
-
* @returns {
|
|
544
|
+
* @returns {string | undefined}
|
|
556
545
|
*/
|
|
557
|
-
get
|
|
558
|
-
|
|
559
|
-
|
|
546
|
+
get filename() {
|
|
547
|
+
try {
|
|
548
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
549
|
+
wasm.wasminlineimage_filename(retptr, this.__wbg_ptr);
|
|
550
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
551
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
552
|
+
let v1;
|
|
553
|
+
if (r0 !== 0) {
|
|
554
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
555
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
556
|
+
}
|
|
557
|
+
return v1;
|
|
558
|
+
} finally {
|
|
559
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
560
|
+
}
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
563
|
if (Symbol.dispose) WasmInlineImage.prototype[Symbol.dispose] = WasmInlineImage.prototype.free;
|
|
@@ -581,13 +582,10 @@ export class WasmInlineImageConfig {
|
|
|
581
582
|
wasm.__wbg_wasminlineimageconfig_free(ptr, 0);
|
|
582
583
|
}
|
|
583
584
|
/**
|
|
584
|
-
* @param {
|
|
585
|
+
* @param {boolean} capture
|
|
585
586
|
*/
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
this.__wbg_ptr = ret >>> 0;
|
|
589
|
-
WasmInlineImageConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
590
|
-
return this;
|
|
587
|
+
set captureSvg(capture) {
|
|
588
|
+
wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
|
|
591
589
|
}
|
|
592
590
|
/**
|
|
593
591
|
* @param {string | null} [prefix]
|
|
@@ -597,18 +595,21 @@ export class WasmInlineImageConfig {
|
|
|
597
595
|
var len0 = WASM_VECTOR_LEN;
|
|
598
596
|
wasm.wasminlineimageconfig_set_filenamePrefix(this.__wbg_ptr, ptr0, len0);
|
|
599
597
|
}
|
|
600
|
-
/**
|
|
601
|
-
* @param {boolean} capture
|
|
602
|
-
*/
|
|
603
|
-
set captureSvg(capture) {
|
|
604
|
-
wasm.wasminlineimageconfig_set_captureSvg(this.__wbg_ptr, capture);
|
|
605
|
-
}
|
|
606
598
|
/**
|
|
607
599
|
* @param {boolean} infer
|
|
608
600
|
*/
|
|
609
601
|
set inferDimensions(infer) {
|
|
610
602
|
wasm.wasminlineimageconfig_set_inferDimensions(this.__wbg_ptr, infer);
|
|
611
603
|
}
|
|
604
|
+
/**
|
|
605
|
+
* @param {number | null} [max_decoded_size_bytes]
|
|
606
|
+
*/
|
|
607
|
+
constructor(max_decoded_size_bytes) {
|
|
608
|
+
const ret = wasm.wasminlineimageconfig_new(!isLikeNone(max_decoded_size_bytes), isLikeNone(max_decoded_size_bytes) ? 0 : max_decoded_size_bytes);
|
|
609
|
+
this.__wbg_ptr = ret >>> 0;
|
|
610
|
+
WasmInlineImageConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
611
|
+
return this;
|
|
612
|
+
}
|
|
612
613
|
}
|
|
613
614
|
if (Symbol.dispose) WasmInlineImageConfig.prototype[Symbol.dispose] = WasmInlineImageConfig.prototype.free;
|
|
614
615
|
|
|
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;
|