html-to-markdown-wasm 2.11.1 → 2.11.3
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 +57 -7
- package/dist/html_to_markdown_wasm_bg.wasm +0 -0
- package/dist/package.json +1 -1
- 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_bg.wasm +0 -0
- package/dist-web/package.json +1 -1
- package/package.json +66 -66
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
export class WasmConversionOptionsHandle {
|
|
5
5
|
free(): void;
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
|
-
constructor(options
|
|
7
|
+
constructor(options?: WasmConversionOptions | null);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export class WasmHtmlExtraction {
|
|
@@ -20,7 +20,7 @@ export class WasmInlineImage {
|
|
|
20
20
|
private constructor();
|
|
21
21
|
free(): void;
|
|
22
22
|
[Symbol.dispose](): void;
|
|
23
|
-
readonly attributes:
|
|
23
|
+
readonly attributes: Record<string, string>;
|
|
24
24
|
readonly dimensions: Uint32Array | undefined;
|
|
25
25
|
readonly description: string | undefined;
|
|
26
26
|
readonly data: Uint8Array;
|
|
@@ -64,19 +64,19 @@ export class WasmInlineImageWarning {
|
|
|
64
64
|
* console.log(markdown); // # Hello World
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
|
-
export function convert(html: string, options
|
|
67
|
+
export function convert(html: string, options?: WasmConversionOptions | null): string;
|
|
68
68
|
|
|
69
|
-
export function convertBytes(html: Uint8Array, options
|
|
69
|
+
export function convertBytes(html: Uint8Array, options?: WasmConversionOptions | null): string;
|
|
70
70
|
|
|
71
|
-
export function convertBytesWithInlineImages(html: Uint8Array, options
|
|
71
|
+
export function convertBytesWithInlineImages(html: Uint8Array, options?: WasmConversionOptions | null, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
72
72
|
|
|
73
73
|
export function convertBytesWithOptionsHandle(html: Uint8Array, handle: WasmConversionOptionsHandle): string;
|
|
74
74
|
|
|
75
|
-
export function convertWithInlineImages(html: string, options
|
|
75
|
+
export function convertWithInlineImages(html: string, options?: WasmConversionOptions | null, image_config?: WasmInlineImageConfig | null): WasmHtmlExtraction;
|
|
76
76
|
|
|
77
77
|
export function convertWithOptionsHandle(html: string, handle: WasmConversionOptionsHandle): string;
|
|
78
78
|
|
|
79
|
-
export function createConversionOptionsHandle(options
|
|
79
|
+
export function createConversionOptionsHandle(options?: WasmConversionOptions | null): WasmConversionOptionsHandle;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Initialize panic hook for better error messages in the browser
|
|
@@ -85,3 +85,53 @@ export function init(): void;
|
|
|
85
85
|
|
|
86
86
|
export declare function initWasm(): Promise<void>;
|
|
87
87
|
export declare const wasmReady: Promise<void>;
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
export type WasmHeadingStyle = "underlined" | "atx" | "atxClosed";
|
|
91
|
+
export type WasmListIndentType = "spaces" | "tabs";
|
|
92
|
+
export type WasmWhitespaceMode = "normalized" | "strict";
|
|
93
|
+
export type WasmNewlineStyle = "spaces" | "backslash";
|
|
94
|
+
export type WasmCodeBlockStyle = "indented" | "backticks" | "tildes";
|
|
95
|
+
export type WasmHighlightStyle = "doubleEqual" | "html" | "bold" | "none";
|
|
96
|
+
export type WasmPreprocessingPreset = "minimal" | "standard" | "aggressive";
|
|
97
|
+
|
|
98
|
+
export interface WasmPreprocessingOptions {
|
|
99
|
+
enabled?: boolean;
|
|
100
|
+
preset?: WasmPreprocessingPreset;
|
|
101
|
+
removeNavigation?: boolean;
|
|
102
|
+
removeForms?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface WasmConversionOptions {
|
|
106
|
+
headingStyle?: WasmHeadingStyle;
|
|
107
|
+
listIndentType?: WasmListIndentType;
|
|
108
|
+
listIndentWidth?: number;
|
|
109
|
+
bullets?: string;
|
|
110
|
+
strongEmSymbol?: string;
|
|
111
|
+
escapeAsterisks?: boolean;
|
|
112
|
+
escapeUnderscores?: boolean;
|
|
113
|
+
escapeMisc?: boolean;
|
|
114
|
+
escapeAscii?: boolean;
|
|
115
|
+
codeLanguage?: string;
|
|
116
|
+
autolinks?: boolean;
|
|
117
|
+
defaultTitle?: boolean;
|
|
118
|
+
brInTables?: boolean;
|
|
119
|
+
hocrSpatialTables?: boolean;
|
|
120
|
+
highlightStyle?: WasmHighlightStyle;
|
|
121
|
+
extractMetadata?: boolean;
|
|
122
|
+
whitespaceMode?: WasmWhitespaceMode;
|
|
123
|
+
stripNewlines?: boolean;
|
|
124
|
+
wrap?: boolean;
|
|
125
|
+
wrapWidth?: number;
|
|
126
|
+
convertAsInline?: boolean;
|
|
127
|
+
subSymbol?: string;
|
|
128
|
+
supSymbol?: string;
|
|
129
|
+
newlineStyle?: WasmNewlineStyle;
|
|
130
|
+
codeBlockStyle?: WasmCodeBlockStyle;
|
|
131
|
+
keepInlineImagesIn?: string[];
|
|
132
|
+
preprocessing?: WasmPreprocessingOptions | null;
|
|
133
|
+
encoding?: string;
|
|
134
|
+
debug?: boolean;
|
|
135
|
+
stripTags?: string[];
|
|
136
|
+
preserveTags?: string[];
|
|
137
|
+
}
|
|
Binary file
|
package/dist/package.json
CHANGED
|
Binary file
|
package/dist-node/package.json
CHANGED
|
Binary file
|
package/dist-web/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
2
|
+
"name": "html-to-markdown-wasm",
|
|
3
|
+
"version": "2.11.3",
|
|
4
|
+
"description": "High-performance HTML to Markdown converter - WebAssembly bindings",
|
|
5
|
+
"main": "dist/html_to_markdown_wasm.js",
|
|
6
|
+
"types": "dist/html_to_markdown_wasm.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/html_to_markdown_wasm.js",
|
|
10
|
+
"types": "./dist/html_to_markdown_wasm.d.ts",
|
|
11
|
+
"default": "./dist/html_to_markdown_wasm.js"
|
|
12
|
+
},
|
|
13
|
+
"./dist-node": {
|
|
14
|
+
"import": "./dist-node/html_to_markdown_wasm.js",
|
|
15
|
+
"require": "./dist-node/html_to_markdown_wasm.js",
|
|
16
|
+
"types": "./dist-node/html_to_markdown_wasm.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./dist-node/*": "./dist-node/*",
|
|
19
|
+
"./dist-web": {
|
|
20
|
+
"import": "./dist-web/html_to_markdown_wasm.js",
|
|
21
|
+
"types": "./dist-web/html_to_markdown_wasm.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./dist-web/*": "./dist-web/*"
|
|
24
|
+
},
|
|
25
|
+
"repository": "https://github.com/Goldziher/html-to-markdown",
|
|
26
|
+
"homepage": "https://github.com/Goldziher/html-to-markdown",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": "Na'aman Hirschfeld <nhirschfeld@gmail.com>",
|
|
29
|
+
"bugs": "https://github.com/Goldziher/html-to-markdown/issues",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"html",
|
|
32
|
+
"markdown",
|
|
33
|
+
"converter",
|
|
34
|
+
"rust",
|
|
35
|
+
"wasm",
|
|
36
|
+
"webassembly"
|
|
37
|
+
],
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"dist-node",
|
|
41
|
+
"dist-web",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "wasm-pack build --target bundler --out-dir dist && node ./scripts/patch-bundler-entry.js",
|
|
46
|
+
"build:nodejs": "wasm-pack build --target nodejs --out-dir dist-node",
|
|
47
|
+
"build:web": "wasm-pack build --target web --out-dir dist-web",
|
|
48
|
+
"build:all": "pnpm run build && pnpm run build:nodejs && pnpm run build:web && pnpm run cleanup:gitignore",
|
|
49
|
+
"cleanup:gitignore": "node ./scripts/cleanup-gitignore.js",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"test:wasm-pack": "wasm-pack test --headless --chrome",
|
|
53
|
+
"clean": "rm -rf dist dist-node dist-web node_modules pkg"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "^24.10.1",
|
|
57
|
+
"tsx": "^4.21.0",
|
|
58
|
+
"vitest": "^4.0.15",
|
|
59
|
+
"wasm-pack": "^0.13.1"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"registry": "https://registry.npmjs.org/",
|
|
63
|
+
"access": "public"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"up": "^1.0.2"
|
|
67
|
+
}
|
|
68
68
|
}
|