html-to-markdown-wasm 2.6.3 → 2.6.4
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/dist/html_to_markdown_wasm.d.ts +19 -19
- package/dist/html_to_markdown_wasm_bg.js +47 -48
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/package.json +1 -1
- package/dist-node/html_to_markdown_wasm.d.ts +19 -19
- package/dist-node/html_to_markdown_wasm.js +47 -48
- package/dist-node/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-node/package.json +1 -1
- package/dist-web/html_to_markdown_wasm.d.ts +19 -19
- package/dist-web/html_to_markdown_wasm.js +47 -48
- package/dist-web/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist-web/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Convert HTML to Markdown
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
*
|
|
8
|
+
* * `html` - The HTML string to convert
|
|
9
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
10
|
+
*
|
|
11
|
+
* # Example
|
|
12
|
+
*
|
|
13
|
+
* ```javascript
|
|
14
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
15
|
+
*
|
|
16
|
+
* const html = '<h1>Hello World</h1>';
|
|
17
|
+
* const markdown = convert(html);
|
|
18
|
+
* console.log(markdown); // # Hello World
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function convert(html: string, options: any): string;
|
|
3
22
|
/**
|
|
4
23
|
* Convert HTML to Markdown while collecting inline images
|
|
5
24
|
*
|
|
@@ -28,25 +47,6 @@ export function convertWithInlineImages(html: string, options: any, image_config
|
|
|
28
47
|
* Initialize panic hook for better error messages in the browser
|
|
29
48
|
*/
|
|
30
49
|
export function init(): void;
|
|
31
|
-
/**
|
|
32
|
-
* Convert HTML to Markdown
|
|
33
|
-
*
|
|
34
|
-
* # Arguments
|
|
35
|
-
*
|
|
36
|
-
* * `html` - The HTML string to convert
|
|
37
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
38
|
-
*
|
|
39
|
-
* # Example
|
|
40
|
-
*
|
|
41
|
-
* ```javascript
|
|
42
|
-
* import { convert } from '@html-to-markdown/wasm';
|
|
43
|
-
*
|
|
44
|
-
* const html = '<h1>Hello World</h1>';
|
|
45
|
-
* const markdown = convert(html);
|
|
46
|
-
* console.log(markdown); // # Hello World
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export function convert(html: string, options: any): string;
|
|
50
50
|
/**
|
|
51
51
|
* Result of HTML extraction with inline images
|
|
52
52
|
*/
|
|
@@ -231,6 +231,53 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
231
231
|
}
|
|
232
232
|
return result;
|
|
233
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Convert HTML to Markdown
|
|
236
|
+
*
|
|
237
|
+
* # Arguments
|
|
238
|
+
*
|
|
239
|
+
* * `html` - The HTML string to convert
|
|
240
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
241
|
+
*
|
|
242
|
+
* # Example
|
|
243
|
+
*
|
|
244
|
+
* ```javascript
|
|
245
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
246
|
+
*
|
|
247
|
+
* const html = '<h1>Hello World</h1>';
|
|
248
|
+
* const markdown = convert(html);
|
|
249
|
+
* console.log(markdown); // # Hello World
|
|
250
|
+
* ```
|
|
251
|
+
* @param {string} html
|
|
252
|
+
* @param {any} options
|
|
253
|
+
* @returns {string}
|
|
254
|
+
*/
|
|
255
|
+
export function convert(html, options) {
|
|
256
|
+
let deferred3_0;
|
|
257
|
+
let deferred3_1;
|
|
258
|
+
try {
|
|
259
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
260
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
261
|
+
const len0 = WASM_VECTOR_LEN;
|
|
262
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
263
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
264
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
265
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
266
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
267
|
+
var ptr2 = r0;
|
|
268
|
+
var len2 = r1;
|
|
269
|
+
if (r3) {
|
|
270
|
+
ptr2 = 0; len2 = 0;
|
|
271
|
+
throw takeObject(r2);
|
|
272
|
+
}
|
|
273
|
+
deferred3_0 = ptr2;
|
|
274
|
+
deferred3_1 = len2;
|
|
275
|
+
return getStringFromWasm0(ptr2, len2);
|
|
276
|
+
} finally {
|
|
277
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
278
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
234
281
|
|
|
235
282
|
function _assertClass(instance, klass) {
|
|
236
283
|
if (!(instance instanceof klass)) {
|
|
@@ -294,54 +341,6 @@ export function init() {
|
|
|
294
341
|
wasm.init();
|
|
295
342
|
}
|
|
296
343
|
|
|
297
|
-
/**
|
|
298
|
-
* Convert HTML to Markdown
|
|
299
|
-
*
|
|
300
|
-
* # Arguments
|
|
301
|
-
*
|
|
302
|
-
* * `html` - The HTML string to convert
|
|
303
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
304
|
-
*
|
|
305
|
-
* # Example
|
|
306
|
-
*
|
|
307
|
-
* ```javascript
|
|
308
|
-
* import { convert } from '@html-to-markdown/wasm';
|
|
309
|
-
*
|
|
310
|
-
* const html = '<h1>Hello World</h1>';
|
|
311
|
-
* const markdown = convert(html);
|
|
312
|
-
* console.log(markdown); // # Hello World
|
|
313
|
-
* ```
|
|
314
|
-
* @param {string} html
|
|
315
|
-
* @param {any} options
|
|
316
|
-
* @returns {string}
|
|
317
|
-
*/
|
|
318
|
-
export function convert(html, options) {
|
|
319
|
-
let deferred3_0;
|
|
320
|
-
let deferred3_1;
|
|
321
|
-
try {
|
|
322
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
323
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
324
|
-
const len0 = WASM_VECTOR_LEN;
|
|
325
|
-
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
326
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
327
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
328
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
329
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
330
|
-
var ptr2 = r0;
|
|
331
|
-
var len2 = r1;
|
|
332
|
-
if (r3) {
|
|
333
|
-
ptr2 = 0; len2 = 0;
|
|
334
|
-
throw takeObject(r2);
|
|
335
|
-
}
|
|
336
|
-
deferred3_0 = ptr2;
|
|
337
|
-
deferred3_1 = len2;
|
|
338
|
-
return getStringFromWasm0(ptr2, len2);
|
|
339
|
-
} finally {
|
|
340
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
341
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
344
|
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
346
345
|
? { register: () => {}, unregister: () => {} }
|
|
347
346
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
Binary file
|
package/dist/package.json
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Convert HTML to Markdown
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
*
|
|
8
|
+
* * `html` - The HTML string to convert
|
|
9
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
10
|
+
*
|
|
11
|
+
* # Example
|
|
12
|
+
*
|
|
13
|
+
* ```javascript
|
|
14
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
15
|
+
*
|
|
16
|
+
* const html = '<h1>Hello World</h1>';
|
|
17
|
+
* const markdown = convert(html);
|
|
18
|
+
* console.log(markdown); // # Hello World
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function convert(html: string, options: any): string;
|
|
3
22
|
/**
|
|
4
23
|
* Convert HTML to Markdown while collecting inline images
|
|
5
24
|
*
|
|
@@ -28,25 +47,6 @@ export function convertWithInlineImages(html: string, options: any, image_config
|
|
|
28
47
|
* Initialize panic hook for better error messages in the browser
|
|
29
48
|
*/
|
|
30
49
|
export function init(): void;
|
|
31
|
-
/**
|
|
32
|
-
* Convert HTML to Markdown
|
|
33
|
-
*
|
|
34
|
-
* # Arguments
|
|
35
|
-
*
|
|
36
|
-
* * `html` - The HTML string to convert
|
|
37
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
38
|
-
*
|
|
39
|
-
* # Example
|
|
40
|
-
*
|
|
41
|
-
* ```javascript
|
|
42
|
-
* import { convert } from '@html-to-markdown/wasm';
|
|
43
|
-
*
|
|
44
|
-
* const html = '<h1>Hello World</h1>';
|
|
45
|
-
* const markdown = convert(html);
|
|
46
|
-
* console.log(markdown); // # Hello World
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export function convert(html: string, options: any): string;
|
|
50
50
|
/**
|
|
51
51
|
* Result of HTML extraction with inline images
|
|
52
52
|
*/
|
|
@@ -221,6 +221,53 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
221
221
|
}
|
|
222
222
|
return result;
|
|
223
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Convert HTML to Markdown
|
|
226
|
+
*
|
|
227
|
+
* # Arguments
|
|
228
|
+
*
|
|
229
|
+
* * `html` - The HTML string to convert
|
|
230
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
231
|
+
*
|
|
232
|
+
* # Example
|
|
233
|
+
*
|
|
234
|
+
* ```javascript
|
|
235
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
236
|
+
*
|
|
237
|
+
* const html = '<h1>Hello World</h1>';
|
|
238
|
+
* const markdown = convert(html);
|
|
239
|
+
* console.log(markdown); // # Hello World
|
|
240
|
+
* ```
|
|
241
|
+
* @param {string} html
|
|
242
|
+
* @param {any} options
|
|
243
|
+
* @returns {string}
|
|
244
|
+
*/
|
|
245
|
+
exports.convert = function(html, options) {
|
|
246
|
+
let deferred3_0;
|
|
247
|
+
let deferred3_1;
|
|
248
|
+
try {
|
|
249
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
250
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
251
|
+
const len0 = WASM_VECTOR_LEN;
|
|
252
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
253
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
254
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
255
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
256
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
257
|
+
var ptr2 = r0;
|
|
258
|
+
var len2 = r1;
|
|
259
|
+
if (r3) {
|
|
260
|
+
ptr2 = 0; len2 = 0;
|
|
261
|
+
throw takeObject(r2);
|
|
262
|
+
}
|
|
263
|
+
deferred3_0 = ptr2;
|
|
264
|
+
deferred3_1 = len2;
|
|
265
|
+
return getStringFromWasm0(ptr2, len2);
|
|
266
|
+
} finally {
|
|
267
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
268
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
224
271
|
|
|
225
272
|
function _assertClass(instance, klass) {
|
|
226
273
|
if (!(instance instanceof klass)) {
|
|
@@ -284,54 +331,6 @@ exports.init = function() {
|
|
|
284
331
|
wasm.init();
|
|
285
332
|
};
|
|
286
333
|
|
|
287
|
-
/**
|
|
288
|
-
* Convert HTML to Markdown
|
|
289
|
-
*
|
|
290
|
-
* # Arguments
|
|
291
|
-
*
|
|
292
|
-
* * `html` - The HTML string to convert
|
|
293
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
294
|
-
*
|
|
295
|
-
* # Example
|
|
296
|
-
*
|
|
297
|
-
* ```javascript
|
|
298
|
-
* import { convert } from '@html-to-markdown/wasm';
|
|
299
|
-
*
|
|
300
|
-
* const html = '<h1>Hello World</h1>';
|
|
301
|
-
* const markdown = convert(html);
|
|
302
|
-
* console.log(markdown); // # Hello World
|
|
303
|
-
* ```
|
|
304
|
-
* @param {string} html
|
|
305
|
-
* @param {any} options
|
|
306
|
-
* @returns {string}
|
|
307
|
-
*/
|
|
308
|
-
exports.convert = function(html, options) {
|
|
309
|
-
let deferred3_0;
|
|
310
|
-
let deferred3_1;
|
|
311
|
-
try {
|
|
312
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
313
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
314
|
-
const len0 = WASM_VECTOR_LEN;
|
|
315
|
-
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
316
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
317
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
318
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
319
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
320
|
-
var ptr2 = r0;
|
|
321
|
-
var len2 = r1;
|
|
322
|
-
if (r3) {
|
|
323
|
-
ptr2 = 0; len2 = 0;
|
|
324
|
-
throw takeObject(r2);
|
|
325
|
-
}
|
|
326
|
-
deferred3_0 = ptr2;
|
|
327
|
-
deferred3_1 = len2;
|
|
328
|
-
return getStringFromWasm0(ptr2, len2);
|
|
329
|
-
} finally {
|
|
330
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
331
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
|
|
335
334
|
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
336
335
|
? { register: () => {}, unregister: () => {} }
|
|
337
336
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
Binary file
|
package/dist-node/package.json
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Convert HTML to Markdown
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
*
|
|
8
|
+
* * `html` - The HTML string to convert
|
|
9
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
10
|
+
*
|
|
11
|
+
* # Example
|
|
12
|
+
*
|
|
13
|
+
* ```javascript
|
|
14
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
15
|
+
*
|
|
16
|
+
* const html = '<h1>Hello World</h1>';
|
|
17
|
+
* const markdown = convert(html);
|
|
18
|
+
* console.log(markdown); // # Hello World
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function convert(html: string, options: any): string;
|
|
3
22
|
/**
|
|
4
23
|
* Convert HTML to Markdown while collecting inline images
|
|
5
24
|
*
|
|
@@ -28,25 +47,6 @@ export function convertWithInlineImages(html: string, options: any, image_config
|
|
|
28
47
|
* Initialize panic hook for better error messages in the browser
|
|
29
48
|
*/
|
|
30
49
|
export function init(): void;
|
|
31
|
-
/**
|
|
32
|
-
* Convert HTML to Markdown
|
|
33
|
-
*
|
|
34
|
-
* # Arguments
|
|
35
|
-
*
|
|
36
|
-
* * `html` - The HTML string to convert
|
|
37
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
38
|
-
*
|
|
39
|
-
* # Example
|
|
40
|
-
*
|
|
41
|
-
* ```javascript
|
|
42
|
-
* import { convert } from '@html-to-markdown/wasm';
|
|
43
|
-
*
|
|
44
|
-
* const html = '<h1>Hello World</h1>';
|
|
45
|
-
* const markdown = convert(html);
|
|
46
|
-
* console.log(markdown); // # Hello World
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export function convert(html: string, options: any): string;
|
|
50
50
|
/**
|
|
51
51
|
* Result of HTML extraction with inline images
|
|
52
52
|
*/
|
|
@@ -227,6 +227,53 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
227
227
|
}
|
|
228
228
|
return result;
|
|
229
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Convert HTML to Markdown
|
|
232
|
+
*
|
|
233
|
+
* # Arguments
|
|
234
|
+
*
|
|
235
|
+
* * `html` - The HTML string to convert
|
|
236
|
+
* * `options` - Optional conversion options (as a JavaScript object)
|
|
237
|
+
*
|
|
238
|
+
* # Example
|
|
239
|
+
*
|
|
240
|
+
* ```javascript
|
|
241
|
+
* import { convert } from '@html-to-markdown/wasm';
|
|
242
|
+
*
|
|
243
|
+
* const html = '<h1>Hello World</h1>';
|
|
244
|
+
* const markdown = convert(html);
|
|
245
|
+
* console.log(markdown); // # Hello World
|
|
246
|
+
* ```
|
|
247
|
+
* @param {string} html
|
|
248
|
+
* @param {any} options
|
|
249
|
+
* @returns {string}
|
|
250
|
+
*/
|
|
251
|
+
export function convert(html, options) {
|
|
252
|
+
let deferred3_0;
|
|
253
|
+
let deferred3_1;
|
|
254
|
+
try {
|
|
255
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
256
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
257
|
+
const len0 = WASM_VECTOR_LEN;
|
|
258
|
+
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
259
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
260
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
261
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
262
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
263
|
+
var ptr2 = r0;
|
|
264
|
+
var len2 = r1;
|
|
265
|
+
if (r3) {
|
|
266
|
+
ptr2 = 0; len2 = 0;
|
|
267
|
+
throw takeObject(r2);
|
|
268
|
+
}
|
|
269
|
+
deferred3_0 = ptr2;
|
|
270
|
+
deferred3_1 = len2;
|
|
271
|
+
return getStringFromWasm0(ptr2, len2);
|
|
272
|
+
} finally {
|
|
273
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
274
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
230
277
|
|
|
231
278
|
function _assertClass(instance, klass) {
|
|
232
279
|
if (!(instance instanceof klass)) {
|
|
@@ -290,54 +337,6 @@ export function init() {
|
|
|
290
337
|
wasm.init();
|
|
291
338
|
}
|
|
292
339
|
|
|
293
|
-
/**
|
|
294
|
-
* Convert HTML to Markdown
|
|
295
|
-
*
|
|
296
|
-
* # Arguments
|
|
297
|
-
*
|
|
298
|
-
* * `html` - The HTML string to convert
|
|
299
|
-
* * `options` - Optional conversion options (as a JavaScript object)
|
|
300
|
-
*
|
|
301
|
-
* # Example
|
|
302
|
-
*
|
|
303
|
-
* ```javascript
|
|
304
|
-
* import { convert } from '@html-to-markdown/wasm';
|
|
305
|
-
*
|
|
306
|
-
* const html = '<h1>Hello World</h1>';
|
|
307
|
-
* const markdown = convert(html);
|
|
308
|
-
* console.log(markdown); // # Hello World
|
|
309
|
-
* ```
|
|
310
|
-
* @param {string} html
|
|
311
|
-
* @param {any} options
|
|
312
|
-
* @returns {string}
|
|
313
|
-
*/
|
|
314
|
-
export function convert(html, options) {
|
|
315
|
-
let deferred3_0;
|
|
316
|
-
let deferred3_1;
|
|
317
|
-
try {
|
|
318
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
319
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
320
|
-
const len0 = WASM_VECTOR_LEN;
|
|
321
|
-
wasm.convert(retptr, ptr0, len0, addHeapObject(options));
|
|
322
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
323
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
324
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
325
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
326
|
-
var ptr2 = r0;
|
|
327
|
-
var len2 = r1;
|
|
328
|
-
if (r3) {
|
|
329
|
-
ptr2 = 0; len2 = 0;
|
|
330
|
-
throw takeObject(r2);
|
|
331
|
-
}
|
|
332
|
-
deferred3_0 = ptr2;
|
|
333
|
-
deferred3_1 = len2;
|
|
334
|
-
return getStringFromWasm0(ptr2, len2);
|
|
335
|
-
} finally {
|
|
336
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
337
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
340
|
const WasmHtmlExtractionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
342
341
|
? { register: () => {}, unregister: () => {} }
|
|
343
342
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmhtmlextraction_free(ptr >>> 0, 1));
|
|
Binary file
|
package/dist-web/package.json
CHANGED
package/package.json
CHANGED