@kreuzberg/html-to-markdown-wasm 3.5.4 → 3.6.0-rc.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/package.json +1 -1
- package/pkg/bundler/html_to_markdown_wasm.d.ts +31 -3
- package/pkg/bundler/html_to_markdown_wasm.js +1 -1
- package/pkg/bundler/html_to_markdown_wasm_bg.js +82 -5
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/bundler/html_to_markdown_wasm_bg.wasm.d.ts +6 -2
- package/pkg/bundler/package.json +1 -1
- package/pkg/deno/html_to_markdown_wasm.d.ts +31 -3
- package/pkg/deno/html_to_markdown_wasm.js +82 -5
- package/pkg/deno/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/deno/html_to_markdown_wasm_bg.wasm.d.ts +6 -2
- package/pkg/nodejs/html_to_markdown_wasm.d.ts +31 -3
- package/pkg/nodejs/html_to_markdown_wasm.js +83 -5
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/nodejs/html_to_markdown_wasm_bg.wasm.d.ts +6 -2
- package/pkg/nodejs/package.json +1 -1
- package/pkg/web/html_to_markdown_wasm.d.ts +37 -5
- package/pkg/web/html_to_markdown_wasm.js +82 -5
- package/pkg/web/html_to_markdown_wasm_bg.wasm +0 -0
- package/pkg/web/html_to_markdown_wasm_bg.wasm.d.ts +6 -2
- package/pkg/web/package.json +1 -1
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ export class WasmConversionOptions {
|
|
|
40
40
|
free(): void;
|
|
41
41
|
[Symbol.dispose](): void;
|
|
42
42
|
static default(): WasmConversionOptions;
|
|
43
|
-
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, excludeSelectors?: string[] | null, maxDepth?: number | null);
|
|
43
|
+
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, urlEscapeStyle?: WasmUrlEscapeStyle | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, excludeSelectors?: string[] | null, maxDepth?: number | null);
|
|
44
44
|
autolinks: boolean;
|
|
45
45
|
brInTables: boolean;
|
|
46
46
|
bullets: string;
|
|
@@ -87,6 +87,8 @@ export class WasmConversionOptions {
|
|
|
87
87
|
strongEmSymbol: string;
|
|
88
88
|
subSymbol: string;
|
|
89
89
|
supSymbol: string;
|
|
90
|
+
get urlEscapeStyle(): string;
|
|
91
|
+
set urlEscapeStyle(value: WasmUrlEscapeStyle);
|
|
90
92
|
get visitor(): WasmVisitorHandle | undefined;
|
|
91
93
|
set visitor(value: WasmVisitorHandle | null | undefined);
|
|
92
94
|
get whitespaceMode(): string;
|
|
@@ -105,7 +107,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
105
107
|
free(): void;
|
|
106
108
|
[Symbol.dispose](): void;
|
|
107
109
|
static default(): WasmConversionOptionsUpdate;
|
|
108
|
-
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, maxDepth?: number | null, excludeSelectors?: string[] | null);
|
|
110
|
+
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, urlEscapeStyle?: WasmUrlEscapeStyle | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, maxDepth?: number | null, excludeSelectors?: string[] | null);
|
|
109
111
|
get autolinks(): boolean | undefined;
|
|
110
112
|
set autolinks(value: boolean | null | undefined);
|
|
111
113
|
get brInTables(): boolean | undefined;
|
|
@@ -182,6 +184,8 @@ export class WasmConversionOptionsUpdate {
|
|
|
182
184
|
set subSymbol(value: string | null | undefined);
|
|
183
185
|
get supSymbol(): string | undefined;
|
|
184
186
|
set supSymbol(value: string | null | undefined);
|
|
187
|
+
get urlEscapeStyle(): string | undefined;
|
|
188
|
+
set urlEscapeStyle(value: WasmUrlEscapeStyle | null | undefined);
|
|
185
189
|
get visitor(): WasmVisitorHandle | undefined;
|
|
186
190
|
set visitor(value: WasmVisitorHandle | null | undefined);
|
|
187
191
|
get whitespaceMode(): string | undefined;
|
|
@@ -826,6 +830,25 @@ export enum WasmTextDirection {
|
|
|
826
830
|
Auto = 2,
|
|
827
831
|
}
|
|
828
832
|
|
|
833
|
+
/**
|
|
834
|
+
* URL encoding strategy for link and image destinations.
|
|
835
|
+
*
|
|
836
|
+
* Controls how special characters in URL destinations are handled when they
|
|
837
|
+
* require escaping to produce valid Markdown.
|
|
838
|
+
*
|
|
839
|
+
* The `Angle` variant (default) wraps the destination in angle brackets:
|
|
840
|
+
* `[text](<url with spaces>)`. This is the CommonMark-specified escape hatch
|
|
841
|
+
* but breaks when the URL itself contains `>`.
|
|
842
|
+
*
|
|
843
|
+
* The `Percent` variant percent-encodes every character that is not an RFC 3986
|
|
844
|
+
* unreserved character or `/`, producing a destination safe for all Markdown
|
|
845
|
+
* parsers: `[text](url%20with%20spaces)`.
|
|
846
|
+
*/
|
|
847
|
+
export enum WasmUrlEscapeStyle {
|
|
848
|
+
Angle = 0,
|
|
849
|
+
Percent = 1,
|
|
850
|
+
}
|
|
851
|
+
|
|
829
852
|
/**
|
|
830
853
|
* Result of a visitor callback.
|
|
831
854
|
*
|
|
@@ -884,7 +907,12 @@ export enum WasmWhitespaceMode {
|
|
|
884
907
|
* # Arguments
|
|
885
908
|
*
|
|
886
909
|
* * `html` — the HTML string to convert.
|
|
887
|
-
* * `options` —
|
|
910
|
+
* * `options` — conversion options. The parameter bound is
|
|
911
|
+
* `impl Into<Option<ConversionOptions>>`, so any of the following call shapes are accepted:
|
|
912
|
+
* - `convert(html, ConversionOptions.default())` — bare options.
|
|
913
|
+
* - `convert(html, opts)` — bare options.
|
|
914
|
+
* - `convert(html, Some(opts))` — explicit `Option`.
|
|
915
|
+
* - `convert(html, None)` — fall back to `ConversionOptions.default`.
|
|
888
916
|
*
|
|
889
917
|
* # Example
|
|
890
918
|
*
|
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./html_to_markdown_wasm_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
|
-
WasmAnnotationKind, WasmCodeBlockStyle, WasmConversionOptions, WasmConversionOptionsUpdate, WasmConversionResult, WasmDocumentMetadata, WasmDocumentNode, WasmDocumentStructure, WasmGridCell, WasmHeaderMetadata, WasmHeadingStyle, WasmHighlightStyle, WasmHtmlMetadata, WasmImageMetadata, WasmImageType, WasmLinkMetadata, WasmLinkStyle, WasmLinkType, WasmListIndentType, WasmNewlineStyle, WasmNodeContent, WasmNodeContext, WasmNodeType, WasmOutputFormat, WasmPreprocessingOptions, WasmPreprocessingOptionsUpdate, WasmPreprocessingPreset, WasmProcessingWarning, WasmStructuredData, WasmStructuredDataType, WasmTableData, WasmTableGrid, WasmTextAnnotation, WasmTextDirection, WasmVisitResult, WasmVisitorHandle, WasmWarningKind, WasmWhitespaceMode, convert
|
|
8
|
+
WasmAnnotationKind, WasmCodeBlockStyle, WasmConversionOptions, WasmConversionOptionsUpdate, WasmConversionResult, WasmDocumentMetadata, WasmDocumentNode, WasmDocumentStructure, WasmGridCell, WasmHeaderMetadata, WasmHeadingStyle, WasmHighlightStyle, WasmHtmlMetadata, WasmImageMetadata, WasmImageType, WasmLinkMetadata, WasmLinkStyle, WasmLinkType, WasmListIndentType, WasmNewlineStyle, WasmNodeContent, WasmNodeContext, WasmNodeType, WasmOutputFormat, WasmPreprocessingOptions, WasmPreprocessingOptionsUpdate, WasmPreprocessingPreset, WasmProcessingWarning, WasmStructuredData, WasmStructuredDataType, WasmTableData, WasmTableGrid, WasmTextAnnotation, WasmTextDirection, WasmUrlEscapeStyle, WasmVisitResult, WasmVisitorHandle, WasmWarningKind, WasmWhitespaceMode, convert
|
|
9
9
|
} from "./html_to_markdown_wasm_bg.js";
|
|
@@ -503,6 +503,7 @@ export class WasmConversionOptions {
|
|
|
503
503
|
* @param {string[] | null} [stripTags]
|
|
504
504
|
* @param {string[] | null} [preserveTags]
|
|
505
505
|
* @param {boolean | null} [skipImages]
|
|
506
|
+
* @param {WasmUrlEscapeStyle | null} [urlEscapeStyle]
|
|
506
507
|
* @param {WasmLinkStyle | null} [linkStyle]
|
|
507
508
|
* @param {WasmOutputFormat | null} [outputFormat]
|
|
508
509
|
* @param {boolean | null} [includeDocumentStructure]
|
|
@@ -513,7 +514,7 @@ export class WasmConversionOptions {
|
|
|
513
514
|
* @param {string[] | null} [excludeSelectors]
|
|
514
515
|
* @param {number | null} [maxDepth]
|
|
515
516
|
*/
|
|
516
|
-
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, excludeSelectors, maxDepth) {
|
|
517
|
+
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, urlEscapeStyle, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, excludeSelectors, maxDepth) {
|
|
517
518
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
518
519
|
var len0 = WASM_VECTOR_LEN;
|
|
519
520
|
var ptr1 = isLikeNone(strongEmSymbol) ? 0 : passStringToWasm0(strongEmSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -539,7 +540,7 @@ export class WasmConversionOptions {
|
|
|
539
540
|
var len9 = WASM_VECTOR_LEN;
|
|
540
541
|
var ptr10 = isLikeNone(excludeSelectors) ? 0 : passArrayJsValueToWasm0(excludeSelectors, wasm.__wbindgen_export);
|
|
541
542
|
var len10 = WASM_VECTOR_LEN;
|
|
542
|
-
const ret = wasm.wasmconversionoptions_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, ptr10, len10, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0);
|
|
543
|
+
const ret = wasm.wasmconversionoptions_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(urlEscapeStyle) ? 2 : urlEscapeStyle, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, ptr10, len10, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0);
|
|
543
544
|
this.__wbg_ptr = ret;
|
|
544
545
|
WasmConversionOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
545
546
|
return this;
|
|
@@ -855,6 +856,12 @@ export class WasmConversionOptions {
|
|
|
855
856
|
const len0 = WASM_VECTOR_LEN;
|
|
856
857
|
wasm.wasmconversionoptions_set_supSymbol(this.__wbg_ptr, ptr0, len0);
|
|
857
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* @param {WasmUrlEscapeStyle} value
|
|
861
|
+
*/
|
|
862
|
+
set urlEscapeStyle(value) {
|
|
863
|
+
wasm.wasmconversionoptions_set_urlEscapeStyle(this.__wbg_ptr, value);
|
|
864
|
+
}
|
|
858
865
|
/**
|
|
859
866
|
* @param {WasmVisitorHandle | null} [value]
|
|
860
867
|
*/
|
|
@@ -971,6 +978,25 @@ export class WasmConversionOptions {
|
|
|
971
978
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
972
979
|
}
|
|
973
980
|
}
|
|
981
|
+
/**
|
|
982
|
+
* @returns {string}
|
|
983
|
+
*/
|
|
984
|
+
get urlEscapeStyle() {
|
|
985
|
+
let deferred1_0;
|
|
986
|
+
let deferred1_1;
|
|
987
|
+
try {
|
|
988
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
989
|
+
wasm.wasmconversionoptions_urlEscapeStyle(retptr, this.__wbg_ptr);
|
|
990
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
991
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
992
|
+
deferred1_0 = r0;
|
|
993
|
+
deferred1_1 = r1;
|
|
994
|
+
return getStringFromWasm0(r0, r1);
|
|
995
|
+
} finally {
|
|
996
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
997
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
974
1000
|
/**
|
|
975
1001
|
* @returns {WasmVisitorHandle | undefined}
|
|
976
1002
|
*/
|
|
@@ -1400,6 +1426,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1400
1426
|
* @param {string[] | null} [stripTags]
|
|
1401
1427
|
* @param {string[] | null} [preserveTags]
|
|
1402
1428
|
* @param {boolean | null} [skipImages]
|
|
1429
|
+
* @param {WasmUrlEscapeStyle | null} [urlEscapeStyle]
|
|
1403
1430
|
* @param {WasmLinkStyle | null} [linkStyle]
|
|
1404
1431
|
* @param {WasmOutputFormat | null} [outputFormat]
|
|
1405
1432
|
* @param {boolean | null} [includeDocumentStructure]
|
|
@@ -1410,7 +1437,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1410
1437
|
* @param {number | null} [maxDepth]
|
|
1411
1438
|
* @param {string[] | null} [excludeSelectors]
|
|
1412
1439
|
*/
|
|
1413
|
-
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, maxDepth, excludeSelectors) {
|
|
1440
|
+
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, urlEscapeStyle, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, maxDepth, excludeSelectors) {
|
|
1414
1441
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1415
1442
|
var len0 = WASM_VECTOR_LEN;
|
|
1416
1443
|
var ptr1 = isLikeNone(strongEmSymbol) ? 0 : passStringToWasm0(strongEmSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1436,7 +1463,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1436
1463
|
var len9 = WASM_VECTOR_LEN;
|
|
1437
1464
|
var ptr10 = isLikeNone(excludeSelectors) ? 0 : passArrayJsValueToWasm0(excludeSelectors, wasm.__wbindgen_export);
|
|
1438
1465
|
var len10 = WASM_VECTOR_LEN;
|
|
1439
|
-
const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, ptr10, len10);
|
|
1466
|
+
const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(urlEscapeStyle) ? 2 : urlEscapeStyle, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, ptr10, len10);
|
|
1440
1467
|
this.__wbg_ptr = ret;
|
|
1441
1468
|
WasmConversionOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
1442
1469
|
return this;
|
|
@@ -1758,6 +1785,12 @@ export class WasmConversionOptionsUpdate {
|
|
|
1758
1785
|
var len0 = WASM_VECTOR_LEN;
|
|
1759
1786
|
wasm.wasmconversionoptionsupdate_set_supSymbol(this.__wbg_ptr, ptr0, len0);
|
|
1760
1787
|
}
|
|
1788
|
+
/**
|
|
1789
|
+
* @param {WasmUrlEscapeStyle | null} [value]
|
|
1790
|
+
*/
|
|
1791
|
+
set urlEscapeStyle(value) {
|
|
1792
|
+
wasm.wasmconversionoptionsupdate_set_urlEscapeStyle(this.__wbg_ptr, isLikeNone(value) ? 2 : value);
|
|
1793
|
+
}
|
|
1761
1794
|
/**
|
|
1762
1795
|
* @param {WasmVisitorHandle | null} [value]
|
|
1763
1796
|
*/
|
|
@@ -1877,6 +1910,25 @@ export class WasmConversionOptionsUpdate {
|
|
|
1877
1910
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1878
1911
|
}
|
|
1879
1912
|
}
|
|
1913
|
+
/**
|
|
1914
|
+
* @returns {string | undefined}
|
|
1915
|
+
*/
|
|
1916
|
+
get urlEscapeStyle() {
|
|
1917
|
+
try {
|
|
1918
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1919
|
+
wasm.wasmconversionoptionsupdate_urlEscapeStyle(retptr, this.__wbg_ptr);
|
|
1920
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1921
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1922
|
+
let v1;
|
|
1923
|
+
if (r0 !== 0) {
|
|
1924
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1925
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1926
|
+
}
|
|
1927
|
+
return v1;
|
|
1928
|
+
} finally {
|
|
1929
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1880
1932
|
/**
|
|
1881
1933
|
* @returns {WasmVisitorHandle | undefined}
|
|
1882
1934
|
*/
|
|
@@ -5181,6 +5233,26 @@ export const WasmTextDirection = Object.freeze({
|
|
|
5181
5233
|
Auto: 2, "2": "Auto",
|
|
5182
5234
|
});
|
|
5183
5235
|
|
|
5236
|
+
/**
|
|
5237
|
+
* URL encoding strategy for link and image destinations.
|
|
5238
|
+
*
|
|
5239
|
+
* Controls how special characters in URL destinations are handled when they
|
|
5240
|
+
* require escaping to produce valid Markdown.
|
|
5241
|
+
*
|
|
5242
|
+
* The `Angle` variant (default) wraps the destination in angle brackets:
|
|
5243
|
+
* `[text](<url with spaces>)`. This is the CommonMark-specified escape hatch
|
|
5244
|
+
* but breaks when the URL itself contains `>`.
|
|
5245
|
+
*
|
|
5246
|
+
* The `Percent` variant percent-encodes every character that is not an RFC 3986
|
|
5247
|
+
* unreserved character or `/`, producing a destination safe for all Markdown
|
|
5248
|
+
* parsers: `[text](url%20with%20spaces)`.
|
|
5249
|
+
* @enum {0 | 1}
|
|
5250
|
+
*/
|
|
5251
|
+
export const WasmUrlEscapeStyle = Object.freeze({
|
|
5252
|
+
Angle: 0, "0": "Angle",
|
|
5253
|
+
Percent: 1, "1": "Percent",
|
|
5254
|
+
});
|
|
5255
|
+
|
|
5184
5256
|
/**
|
|
5185
5257
|
* Result of a visitor callback.
|
|
5186
5258
|
*
|
|
@@ -5265,7 +5337,12 @@ export const WasmWhitespaceMode = Object.freeze({
|
|
|
5265
5337
|
* # Arguments
|
|
5266
5338
|
*
|
|
5267
5339
|
* * `html` — the HTML string to convert.
|
|
5268
|
-
* * `options` —
|
|
5340
|
+
* * `options` — conversion options. The parameter bound is
|
|
5341
|
+
* `impl Into<Option<ConversionOptions>>`, so any of the following call shapes are accepted:
|
|
5342
|
+
* - `convert(html, ConversionOptions.default())` — bare options.
|
|
5343
|
+
* - `convert(html, opts)` — bare options.
|
|
5344
|
+
* - `convert(html, Some(opts))` — explicit `Option`.
|
|
5345
|
+
* - `convert(html, None)` — fall back to `ConversionOptions.default`.
|
|
5269
5346
|
*
|
|
5270
5347
|
* # Example
|
|
5271
5348
|
*
|
|
Binary file
|
|
@@ -59,7 +59,7 @@ export const wasmconversionoptions_listIndentType: (a: number, b: number) => voi
|
|
|
59
59
|
export const wasmconversionoptions_listIndentWidth: (a: number) => number;
|
|
60
60
|
export const wasmconversionoptions_maxDepth: (a: number) => number;
|
|
61
61
|
export const wasmconversionoptions_maxImageSize: (a: number) => bigint;
|
|
62
|
-
export const wasmconversionoptions_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1:
|
|
62
|
+
export const wasmconversionoptions_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: number, v1: bigint, w1: number, x1: number, y1: number, z1: number, a2: number) => number;
|
|
63
63
|
export const wasmconversionoptions_newlineStyle: (a: number, b: number) => void;
|
|
64
64
|
export const wasmconversionoptions_outputFormat: (a: number, b: number) => void;
|
|
65
65
|
export const wasmconversionoptions_preprocessing: (a: number) => number;
|
|
@@ -102,6 +102,7 @@ export const wasmconversionoptions_set_stripTags: (a: number, b: number, c: numb
|
|
|
102
102
|
export const wasmconversionoptions_set_strongEmSymbol: (a: number, b: number, c: number) => void;
|
|
103
103
|
export const wasmconversionoptions_set_subSymbol: (a: number, b: number, c: number) => void;
|
|
104
104
|
export const wasmconversionoptions_set_supSymbol: (a: number, b: number, c: number) => void;
|
|
105
|
+
export const wasmconversionoptions_set_urlEscapeStyle: (a: number, b: number) => void;
|
|
105
106
|
export const wasmconversionoptions_set_visitor: (a: number, b: number) => void;
|
|
106
107
|
export const wasmconversionoptions_set_whitespaceMode: (a: number, b: number) => void;
|
|
107
108
|
export const wasmconversionoptions_set_wrap: (a: number, b: number) => void;
|
|
@@ -112,6 +113,7 @@ export const wasmconversionoptions_stripTags: (a: number, b: number) => void;
|
|
|
112
113
|
export const wasmconversionoptions_strongEmSymbol: (a: number, b: number) => void;
|
|
113
114
|
export const wasmconversionoptions_subSymbol: (a: number, b: number) => void;
|
|
114
115
|
export const wasmconversionoptions_supSymbol: (a: number, b: number) => void;
|
|
116
|
+
export const wasmconversionoptions_urlEscapeStyle: (a: number, b: number) => void;
|
|
115
117
|
export const wasmconversionoptions_visitor: (a: number) => number;
|
|
116
118
|
export const wasmconversionoptions_whitespaceMode: (a: number, b: number) => void;
|
|
117
119
|
export const wasmconversionoptions_wrap: (a: number) => number;
|
|
@@ -145,7 +147,7 @@ export const wasmconversionoptionsupdate_listIndentType: (a: number, b: number)
|
|
|
145
147
|
export const wasmconversionoptionsupdate_listIndentWidth: (a: number) => number;
|
|
146
148
|
export const wasmconversionoptionsupdate_maxDepth: (a: number) => number;
|
|
147
149
|
export const wasmconversionoptionsupdate_maxImageSize: (a: number, b: number) => void;
|
|
148
|
-
export const wasmconversionoptionsupdate_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1:
|
|
150
|
+
export const wasmconversionoptionsupdate_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: number, v1: bigint, w1: number, x1: number, y1: number, z1: number, a2: number) => number;
|
|
149
151
|
export const wasmconversionoptionsupdate_newlineStyle: (a: number, b: number) => void;
|
|
150
152
|
export const wasmconversionoptionsupdate_outputFormat: (a: number, b: number) => void;
|
|
151
153
|
export const wasmconversionoptionsupdate_preprocessing: (a: number) => number;
|
|
@@ -188,6 +190,7 @@ export const wasmconversionoptionsupdate_set_stripTags: (a: number, b: number, c
|
|
|
188
190
|
export const wasmconversionoptionsupdate_set_strongEmSymbol: (a: number, b: number, c: number) => void;
|
|
189
191
|
export const wasmconversionoptionsupdate_set_subSymbol: (a: number, b: number, c: number) => void;
|
|
190
192
|
export const wasmconversionoptionsupdate_set_supSymbol: (a: number, b: number, c: number) => void;
|
|
193
|
+
export const wasmconversionoptionsupdate_set_urlEscapeStyle: (a: number, b: number) => void;
|
|
191
194
|
export const wasmconversionoptionsupdate_set_visitor: (a: number, b: number) => void;
|
|
192
195
|
export const wasmconversionoptionsupdate_set_whitespaceMode: (a: number, b: number) => void;
|
|
193
196
|
export const wasmconversionoptionsupdate_set_wrap: (a: number, b: number) => void;
|
|
@@ -198,6 +201,7 @@ export const wasmconversionoptionsupdate_stripTags: (a: number, b: number) => vo
|
|
|
198
201
|
export const wasmconversionoptionsupdate_strongEmSymbol: (a: number, b: number) => void;
|
|
199
202
|
export const wasmconversionoptionsupdate_subSymbol: (a: number, b: number) => void;
|
|
200
203
|
export const wasmconversionoptionsupdate_supSymbol: (a: number, b: number) => void;
|
|
204
|
+
export const wasmconversionoptionsupdate_urlEscapeStyle: (a: number, b: number) => void;
|
|
201
205
|
export const wasmconversionoptionsupdate_visitor: (a: number) => number;
|
|
202
206
|
export const wasmconversionoptionsupdate_whitespaceMode: (a: number, b: number) => void;
|
|
203
207
|
export const wasmconversionoptionsupdate_wrap: (a: number) => number;
|
package/pkg/bundler/package.json
CHANGED
|
@@ -40,7 +40,7 @@ export class WasmConversionOptions {
|
|
|
40
40
|
free(): void;
|
|
41
41
|
[Symbol.dispose](): void;
|
|
42
42
|
static default(): WasmConversionOptions;
|
|
43
|
-
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, excludeSelectors?: string[] | null, maxDepth?: number | null);
|
|
43
|
+
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptions | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, urlEscapeStyle?: WasmUrlEscapeStyle | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, excludeSelectors?: string[] | null, maxDepth?: number | null);
|
|
44
44
|
autolinks: boolean;
|
|
45
45
|
brInTables: boolean;
|
|
46
46
|
bullets: string;
|
|
@@ -87,6 +87,8 @@ export class WasmConversionOptions {
|
|
|
87
87
|
strongEmSymbol: string;
|
|
88
88
|
subSymbol: string;
|
|
89
89
|
supSymbol: string;
|
|
90
|
+
get urlEscapeStyle(): string;
|
|
91
|
+
set urlEscapeStyle(value: WasmUrlEscapeStyle);
|
|
90
92
|
get visitor(): WasmVisitorHandle | undefined;
|
|
91
93
|
set visitor(value: WasmVisitorHandle | null | undefined);
|
|
92
94
|
get whitespaceMode(): string;
|
|
@@ -105,7 +107,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
105
107
|
free(): void;
|
|
106
108
|
[Symbol.dispose](): void;
|
|
107
109
|
static default(): WasmConversionOptionsUpdate;
|
|
108
|
-
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, maxDepth?: number | null, excludeSelectors?: string[] | null);
|
|
110
|
+
constructor(headingStyle?: WasmHeadingStyle | null, listIndentType?: WasmListIndentType | null, listIndentWidth?: number | null, bullets?: string | null, strongEmSymbol?: string | null, escapeAsterisks?: boolean | null, escapeUnderscores?: boolean | null, escapeMisc?: boolean | null, escapeAscii?: boolean | null, codeLanguage?: string | null, autolinks?: boolean | null, defaultTitle?: boolean | null, brInTables?: boolean | null, compactTables?: boolean | null, highlightStyle?: WasmHighlightStyle | null, extractMetadata?: boolean | null, whitespaceMode?: WasmWhitespaceMode | null, stripNewlines?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, convertAsInline?: boolean | null, subSymbol?: string | null, supSymbol?: string | null, newlineStyle?: WasmNewlineStyle | null, codeBlockStyle?: WasmCodeBlockStyle | null, keepInlineImagesIn?: string[] | null, preprocessing?: WasmPreprocessingOptionsUpdate | null, encoding?: string | null, debug?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, skipImages?: boolean | null, urlEscapeStyle?: WasmUrlEscapeStyle | null, linkStyle?: WasmLinkStyle | null, outputFormat?: WasmOutputFormat | null, includeDocumentStructure?: boolean | null, extractImages?: boolean | null, maxImageSize?: bigint | null, captureSvg?: boolean | null, inferDimensions?: boolean | null, maxDepth?: number | null, excludeSelectors?: string[] | null);
|
|
109
111
|
get autolinks(): boolean | undefined;
|
|
110
112
|
set autolinks(value: boolean | null | undefined);
|
|
111
113
|
get brInTables(): boolean | undefined;
|
|
@@ -182,6 +184,8 @@ export class WasmConversionOptionsUpdate {
|
|
|
182
184
|
set subSymbol(value: string | null | undefined);
|
|
183
185
|
get supSymbol(): string | undefined;
|
|
184
186
|
set supSymbol(value: string | null | undefined);
|
|
187
|
+
get urlEscapeStyle(): string | undefined;
|
|
188
|
+
set urlEscapeStyle(value: WasmUrlEscapeStyle | null | undefined);
|
|
185
189
|
get visitor(): WasmVisitorHandle | undefined;
|
|
186
190
|
set visitor(value: WasmVisitorHandle | null | undefined);
|
|
187
191
|
get whitespaceMode(): string | undefined;
|
|
@@ -826,6 +830,25 @@ export enum WasmTextDirection {
|
|
|
826
830
|
Auto = 2,
|
|
827
831
|
}
|
|
828
832
|
|
|
833
|
+
/**
|
|
834
|
+
* URL encoding strategy for link and image destinations.
|
|
835
|
+
*
|
|
836
|
+
* Controls how special characters in URL destinations are handled when they
|
|
837
|
+
* require escaping to produce valid Markdown.
|
|
838
|
+
*
|
|
839
|
+
* The `Angle` variant (default) wraps the destination in angle brackets:
|
|
840
|
+
* `[text](<url with spaces>)`. This is the CommonMark-specified escape hatch
|
|
841
|
+
* but breaks when the URL itself contains `>`.
|
|
842
|
+
*
|
|
843
|
+
* The `Percent` variant percent-encodes every character that is not an RFC 3986
|
|
844
|
+
* unreserved character or `/`, producing a destination safe for all Markdown
|
|
845
|
+
* parsers: `[text](url%20with%20spaces)`.
|
|
846
|
+
*/
|
|
847
|
+
export enum WasmUrlEscapeStyle {
|
|
848
|
+
Angle = 0,
|
|
849
|
+
Percent = 1,
|
|
850
|
+
}
|
|
851
|
+
|
|
829
852
|
/**
|
|
830
853
|
* Result of a visitor callback.
|
|
831
854
|
*
|
|
@@ -884,7 +907,12 @@ export enum WasmWhitespaceMode {
|
|
|
884
907
|
* # Arguments
|
|
885
908
|
*
|
|
886
909
|
* * `html` — the HTML string to convert.
|
|
887
|
-
* * `options` —
|
|
910
|
+
* * `options` — conversion options. The parameter bound is
|
|
911
|
+
* `impl Into<Option<ConversionOptions>>`, so any of the following call shapes are accepted:
|
|
912
|
+
* - `convert(html, ConversionOptions.default())` — bare options.
|
|
913
|
+
* - `convert(html, opts)` — bare options.
|
|
914
|
+
* - `convert(html, Some(opts))` — explicit `Option`.
|
|
915
|
+
* - `convert(html, None)` — fall back to `ConversionOptions.default`.
|
|
888
916
|
*
|
|
889
917
|
* # Example
|
|
890
918
|
*
|
|
@@ -505,6 +505,7 @@ export class WasmConversionOptions {
|
|
|
505
505
|
* @param {string[] | null} [stripTags]
|
|
506
506
|
* @param {string[] | null} [preserveTags]
|
|
507
507
|
* @param {boolean | null} [skipImages]
|
|
508
|
+
* @param {WasmUrlEscapeStyle | null} [urlEscapeStyle]
|
|
508
509
|
* @param {WasmLinkStyle | null} [linkStyle]
|
|
509
510
|
* @param {WasmOutputFormat | null} [outputFormat]
|
|
510
511
|
* @param {boolean | null} [includeDocumentStructure]
|
|
@@ -515,7 +516,7 @@ export class WasmConversionOptions {
|
|
|
515
516
|
* @param {string[] | null} [excludeSelectors]
|
|
516
517
|
* @param {number | null} [maxDepth]
|
|
517
518
|
*/
|
|
518
|
-
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, excludeSelectors, maxDepth) {
|
|
519
|
+
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, urlEscapeStyle, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, excludeSelectors, maxDepth) {
|
|
519
520
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
520
521
|
var len0 = WASM_VECTOR_LEN;
|
|
521
522
|
var ptr1 = isLikeNone(strongEmSymbol) ? 0 : passStringToWasm0(strongEmSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -541,7 +542,7 @@ export class WasmConversionOptions {
|
|
|
541
542
|
var len9 = WASM_VECTOR_LEN;
|
|
542
543
|
var ptr10 = isLikeNone(excludeSelectors) ? 0 : passArrayJsValueToWasm0(excludeSelectors, wasm.__wbindgen_export);
|
|
543
544
|
var len10 = WASM_VECTOR_LEN;
|
|
544
|
-
const ret = wasm.wasmconversionoptions_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, ptr10, len10, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0);
|
|
545
|
+
const ret = wasm.wasmconversionoptions_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(urlEscapeStyle) ? 2 : urlEscapeStyle, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, ptr10, len10, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0);
|
|
545
546
|
this.__wbg_ptr = ret;
|
|
546
547
|
WasmConversionOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
547
548
|
return this;
|
|
@@ -857,6 +858,12 @@ export class WasmConversionOptions {
|
|
|
857
858
|
const len0 = WASM_VECTOR_LEN;
|
|
858
859
|
wasm.wasmconversionoptions_set_supSymbol(this.__wbg_ptr, ptr0, len0);
|
|
859
860
|
}
|
|
861
|
+
/**
|
|
862
|
+
* @param {WasmUrlEscapeStyle} value
|
|
863
|
+
*/
|
|
864
|
+
set urlEscapeStyle(value) {
|
|
865
|
+
wasm.wasmconversionoptions_set_urlEscapeStyle(this.__wbg_ptr, value);
|
|
866
|
+
}
|
|
860
867
|
/**
|
|
861
868
|
* @param {WasmVisitorHandle | null} [value]
|
|
862
869
|
*/
|
|
@@ -973,6 +980,25 @@ export class WasmConversionOptions {
|
|
|
973
980
|
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
974
981
|
}
|
|
975
982
|
}
|
|
983
|
+
/**
|
|
984
|
+
* @returns {string}
|
|
985
|
+
*/
|
|
986
|
+
get urlEscapeStyle() {
|
|
987
|
+
let deferred1_0;
|
|
988
|
+
let deferred1_1;
|
|
989
|
+
try {
|
|
990
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
991
|
+
wasm.wasmconversionoptions_urlEscapeStyle(retptr, this.__wbg_ptr);
|
|
992
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
993
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
994
|
+
deferred1_0 = r0;
|
|
995
|
+
deferred1_1 = r1;
|
|
996
|
+
return getStringFromWasm0(r0, r1);
|
|
997
|
+
} finally {
|
|
998
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
999
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
976
1002
|
/**
|
|
977
1003
|
* @returns {WasmVisitorHandle | undefined}
|
|
978
1004
|
*/
|
|
@@ -1402,6 +1428,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1402
1428
|
* @param {string[] | null} [stripTags]
|
|
1403
1429
|
* @param {string[] | null} [preserveTags]
|
|
1404
1430
|
* @param {boolean | null} [skipImages]
|
|
1431
|
+
* @param {WasmUrlEscapeStyle | null} [urlEscapeStyle]
|
|
1405
1432
|
* @param {WasmLinkStyle | null} [linkStyle]
|
|
1406
1433
|
* @param {WasmOutputFormat | null} [outputFormat]
|
|
1407
1434
|
* @param {boolean | null} [includeDocumentStructure]
|
|
@@ -1412,7 +1439,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1412
1439
|
* @param {number | null} [maxDepth]
|
|
1413
1440
|
* @param {string[] | null} [excludeSelectors]
|
|
1414
1441
|
*/
|
|
1415
|
-
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, maxDepth, excludeSelectors) {
|
|
1442
|
+
constructor(headingStyle, listIndentType, listIndentWidth, bullets, strongEmSymbol, escapeAsterisks, escapeUnderscores, escapeMisc, escapeAscii, codeLanguage, autolinks, defaultTitle, brInTables, compactTables, highlightStyle, extractMetadata, whitespaceMode, stripNewlines, wrap, wrapWidth, convertAsInline, subSymbol, supSymbol, newlineStyle, codeBlockStyle, keepInlineImagesIn, preprocessing, encoding, debug, stripTags, preserveTags, skipImages, urlEscapeStyle, linkStyle, outputFormat, includeDocumentStructure, extractImages, maxImageSize, captureSvg, inferDimensions, maxDepth, excludeSelectors) {
|
|
1416
1443
|
var ptr0 = isLikeNone(bullets) ? 0 : passStringToWasm0(bullets, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1417
1444
|
var len0 = WASM_VECTOR_LEN;
|
|
1418
1445
|
var ptr1 = isLikeNone(strongEmSymbol) ? 0 : passStringToWasm0(strongEmSymbol, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1438,7 +1465,7 @@ export class WasmConversionOptionsUpdate {
|
|
|
1438
1465
|
var len9 = WASM_VECTOR_LEN;
|
|
1439
1466
|
var ptr10 = isLikeNone(excludeSelectors) ? 0 : passArrayJsValueToWasm0(excludeSelectors, wasm.__wbindgen_export);
|
|
1440
1467
|
var len10 = WASM_VECTOR_LEN;
|
|
1441
|
-
const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, ptr10, len10);
|
|
1468
|
+
const ret = wasm.wasmconversionoptionsupdate_new(isLikeNone(headingStyle) ? 3 : headingStyle, isLikeNone(listIndentType) ? 2 : listIndentType, isLikeNone(listIndentWidth) ? Number.MAX_SAFE_INTEGER : (listIndentWidth) >>> 0, ptr0, len0, ptr1, len1, isLikeNone(escapeAsterisks) ? 0xFFFFFF : escapeAsterisks ? 1 : 0, isLikeNone(escapeUnderscores) ? 0xFFFFFF : escapeUnderscores ? 1 : 0, isLikeNone(escapeMisc) ? 0xFFFFFF : escapeMisc ? 1 : 0, isLikeNone(escapeAscii) ? 0xFFFFFF : escapeAscii ? 1 : 0, ptr2, len2, isLikeNone(autolinks) ? 0xFFFFFF : autolinks ? 1 : 0, isLikeNone(defaultTitle) ? 0xFFFFFF : defaultTitle ? 1 : 0, isLikeNone(brInTables) ? 0xFFFFFF : brInTables ? 1 : 0, isLikeNone(compactTables) ? 0xFFFFFF : compactTables ? 1 : 0, isLikeNone(highlightStyle) ? 4 : highlightStyle, isLikeNone(extractMetadata) ? 0xFFFFFF : extractMetadata ? 1 : 0, isLikeNone(whitespaceMode) ? 2 : whitespaceMode, isLikeNone(stripNewlines) ? 0xFFFFFF : stripNewlines ? 1 : 0, isLikeNone(wrap) ? 0xFFFFFF : wrap ? 1 : 0, isLikeNone(wrapWidth) ? Number.MAX_SAFE_INTEGER : (wrapWidth) >>> 0, isLikeNone(convertAsInline) ? 0xFFFFFF : convertAsInline ? 1 : 0, ptr3, len3, ptr4, len4, isLikeNone(newlineStyle) ? 2 : newlineStyle, isLikeNone(codeBlockStyle) ? 3 : codeBlockStyle, ptr5, len5, ptr6, ptr7, len7, isLikeNone(debug) ? 0xFFFFFF : debug ? 1 : 0, ptr8, len8, ptr9, len9, isLikeNone(skipImages) ? 0xFFFFFF : skipImages ? 1 : 0, isLikeNone(urlEscapeStyle) ? 2 : urlEscapeStyle, isLikeNone(linkStyle) ? 2 : linkStyle, isLikeNone(outputFormat) ? 3 : outputFormat, isLikeNone(includeDocumentStructure) ? 0xFFFFFF : includeDocumentStructure ? 1 : 0, isLikeNone(extractImages) ? 0xFFFFFF : extractImages ? 1 : 0, !isLikeNone(maxImageSize), isLikeNone(maxImageSize) ? BigInt(0) : maxImageSize, isLikeNone(captureSvg) ? 0xFFFFFF : captureSvg ? 1 : 0, isLikeNone(inferDimensions) ? 0xFFFFFF : inferDimensions ? 1 : 0, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, ptr10, len10);
|
|
1442
1469
|
this.__wbg_ptr = ret;
|
|
1443
1470
|
WasmConversionOptionsUpdateFinalization.register(this, this.__wbg_ptr, this);
|
|
1444
1471
|
return this;
|
|
@@ -1760,6 +1787,12 @@ export class WasmConversionOptionsUpdate {
|
|
|
1760
1787
|
var len0 = WASM_VECTOR_LEN;
|
|
1761
1788
|
wasm.wasmconversionoptionsupdate_set_supSymbol(this.__wbg_ptr, ptr0, len0);
|
|
1762
1789
|
}
|
|
1790
|
+
/**
|
|
1791
|
+
* @param {WasmUrlEscapeStyle | null} [value]
|
|
1792
|
+
*/
|
|
1793
|
+
set urlEscapeStyle(value) {
|
|
1794
|
+
wasm.wasmconversionoptionsupdate_set_urlEscapeStyle(this.__wbg_ptr, isLikeNone(value) ? 2 : value);
|
|
1795
|
+
}
|
|
1763
1796
|
/**
|
|
1764
1797
|
* @param {WasmVisitorHandle | null} [value]
|
|
1765
1798
|
*/
|
|
@@ -1879,6 +1912,25 @@ export class WasmConversionOptionsUpdate {
|
|
|
1879
1912
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1880
1913
|
}
|
|
1881
1914
|
}
|
|
1915
|
+
/**
|
|
1916
|
+
* @returns {string | undefined}
|
|
1917
|
+
*/
|
|
1918
|
+
get urlEscapeStyle() {
|
|
1919
|
+
try {
|
|
1920
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1921
|
+
wasm.wasmconversionoptionsupdate_urlEscapeStyle(retptr, this.__wbg_ptr);
|
|
1922
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1923
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1924
|
+
let v1;
|
|
1925
|
+
if (r0 !== 0) {
|
|
1926
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1927
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1928
|
+
}
|
|
1929
|
+
return v1;
|
|
1930
|
+
} finally {
|
|
1931
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1882
1934
|
/**
|
|
1883
1935
|
* @returns {WasmVisitorHandle | undefined}
|
|
1884
1936
|
*/
|
|
@@ -5183,6 +5235,26 @@ export const WasmTextDirection = Object.freeze({
|
|
|
5183
5235
|
Auto: 2, "2": "Auto",
|
|
5184
5236
|
});
|
|
5185
5237
|
|
|
5238
|
+
/**
|
|
5239
|
+
* URL encoding strategy for link and image destinations.
|
|
5240
|
+
*
|
|
5241
|
+
* Controls how special characters in URL destinations are handled when they
|
|
5242
|
+
* require escaping to produce valid Markdown.
|
|
5243
|
+
*
|
|
5244
|
+
* The `Angle` variant (default) wraps the destination in angle brackets:
|
|
5245
|
+
* `[text](<url with spaces>)`. This is the CommonMark-specified escape hatch
|
|
5246
|
+
* but breaks when the URL itself contains `>`.
|
|
5247
|
+
*
|
|
5248
|
+
* The `Percent` variant percent-encodes every character that is not an RFC 3986
|
|
5249
|
+
* unreserved character or `/`, producing a destination safe for all Markdown
|
|
5250
|
+
* parsers: `[text](url%20with%20spaces)`.
|
|
5251
|
+
* @enum {0 | 1}
|
|
5252
|
+
*/
|
|
5253
|
+
export const WasmUrlEscapeStyle = Object.freeze({
|
|
5254
|
+
Angle: 0, "0": "Angle",
|
|
5255
|
+
Percent: 1, "1": "Percent",
|
|
5256
|
+
});
|
|
5257
|
+
|
|
5186
5258
|
/**
|
|
5187
5259
|
* Result of a visitor callback.
|
|
5188
5260
|
*
|
|
@@ -5267,7 +5339,12 @@ export const WasmWhitespaceMode = Object.freeze({
|
|
|
5267
5339
|
* # Arguments
|
|
5268
5340
|
*
|
|
5269
5341
|
* * `html` — the HTML string to convert.
|
|
5270
|
-
* * `options` —
|
|
5342
|
+
* * `options` — conversion options. The parameter bound is
|
|
5343
|
+
* `impl Into<Option<ConversionOptions>>`, so any of the following call shapes are accepted:
|
|
5344
|
+
* - `convert(html, ConversionOptions.default())` — bare options.
|
|
5345
|
+
* - `convert(html, opts)` — bare options.
|
|
5346
|
+
* - `convert(html, Some(opts))` — explicit `Option`.
|
|
5347
|
+
* - `convert(html, None)` — fall back to `ConversionOptions.default`.
|
|
5271
5348
|
*
|
|
5272
5349
|
* # Example
|
|
5273
5350
|
*
|
|
Binary file
|