@ox-content/wasm 2.67.0 → 2.69.0

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.
@@ -2,33 +2,84 @@
2
2
  /* eslint-disable */
3
3
 
4
4
  /**
5
- * Parser options.
5
+ * Parser and renderer options exposed to JavaScript.
6
+ *
7
+ * `new WasmParserOptions()` disables optional Markdown extensions by default
8
+ * and uses renderer defaults for TOC and auto-link handling.
6
9
  */
7
10
  export class WasmParserOptions {
8
11
  free(): void;
9
12
  [Symbol.dispose](): void;
13
+ /**
14
+ * Creates options with all Markdown extension flags disabled.
15
+ *
16
+ * Defaults: `gfm = false`, `tocMaxDepth = 3`, `autolinkUrls = false`,
17
+ * `autolinkPatterns = ["http://", "https://"]`, and
18
+ * `autolinkTargetBlank = true`.
19
+ */
10
20
  constructor();
11
21
  /**
12
22
  * Replaces the URL prefix patterns used by auto-linking. Pass a JS
13
23
  * array of strings such as `["http://", "https://", "ftp://"]`.
24
+ *
25
+ * Default: `["http://", "https://"]`.
14
26
  */
15
27
  set autolinkPatterns(value: string[]);
16
28
  /**
17
29
  * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked
18
30
  * URLs. Has no effect when `autolinkUrls` is off.
31
+ *
32
+ * Default: `true`.
19
33
  */
20
34
  set autolinkTargetBlank(value: boolean);
21
35
  /**
22
36
  * Enables the renderer's URL auto-linking builtin. Bare URLs matching
23
37
  * any registered pattern are wrapped in an `<a>` tag.
38
+ *
39
+ * Default: `false`.
24
40
  */
25
41
  set autolinkUrls(value: boolean);
42
+ /**
43
+ * Enables GFM autolinks in the parser.
44
+ *
45
+ * Default: `false`.
46
+ */
26
47
  set autolinks(value: boolean);
48
+ /**
49
+ * Enables footnote references and definitions.
50
+ *
51
+ * Default: `false`.
52
+ */
27
53
  set footnotes(value: boolean);
54
+ /**
55
+ * Enables the GFM convenience profile.
56
+ *
57
+ * Default: `false`.
58
+ */
28
59
  set gfm(value: boolean);
60
+ /**
61
+ * Enables GFM strikethrough spans.
62
+ *
63
+ * Default: `false`.
64
+ */
29
65
  set strikethrough(value: boolean);
66
+ /**
67
+ * Enables GFM pipe tables.
68
+ *
69
+ * Default: `false`.
70
+ */
30
71
  set tables(value: boolean);
72
+ /**
73
+ * Enables GFM task-list item markers such as `- [x]`.
74
+ *
75
+ * Default: `false`.
76
+ */
31
77
  set taskLists(value: boolean);
78
+ /**
79
+ * Sets the maximum heading depth included in inline TOCs.
80
+ *
81
+ * Default: `3`.
82
+ */
32
83
  set tocMaxDepth(value: number);
33
84
  }
34
85
 
@@ -1,7 +1,10 @@
1
1
  /* @ts-self-types="./ox_content_wasm.d.ts" */
2
2
 
3
3
  /**
4
- * Parser options.
4
+ * Parser and renderer options exposed to JavaScript.
5
+ *
6
+ * `new WasmParserOptions()` disables optional Markdown extensions by default
7
+ * and uses renderer defaults for TOC and auto-link handling.
5
8
  */
6
9
  export class WasmParserOptions {
7
10
  __destroy_into_raw() {
@@ -14,6 +17,13 @@ export class WasmParserOptions {
14
17
  const ptr = this.__destroy_into_raw();
15
18
  wasm.__wbg_wasmparseroptions_free(ptr, 0);
16
19
  }
20
+ /**
21
+ * Creates options with all Markdown extension flags disabled.
22
+ *
23
+ * Defaults: `gfm = false`, `tocMaxDepth = 3`, `autolinkUrls = false`,
24
+ * `autolinkPatterns = ["http://", "https://"]`, and
25
+ * `autolinkTargetBlank = true`.
26
+ */
17
27
  constructor() {
18
28
  const ret = wasm.wasmparseroptions_new();
19
29
  this.__wbg_ptr = ret;
@@ -23,6 +33,8 @@ export class WasmParserOptions {
23
33
  /**
24
34
  * Replaces the URL prefix patterns used by auto-linking. Pass a JS
25
35
  * array of strings such as `["http://", "https://", "ftp://"]`.
36
+ *
37
+ * Default: `["http://", "https://"]`.
26
38
  * @param {string[]} value
27
39
  */
28
40
  set autolinkPatterns(value) {
@@ -33,6 +45,8 @@ export class WasmParserOptions {
33
45
  /**
34
46
  * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked
35
47
  * URLs. Has no effect when `autolinkUrls` is off.
48
+ *
49
+ * Default: `true`.
36
50
  * @param {boolean} value
37
51
  */
38
52
  set autolinkTargetBlank(value) {
@@ -41,48 +55,71 @@ export class WasmParserOptions {
41
55
  /**
42
56
  * Enables the renderer's URL auto-linking builtin. Bare URLs matching
43
57
  * any registered pattern are wrapped in an `<a>` tag.
58
+ *
59
+ * Default: `false`.
44
60
  * @param {boolean} value
45
61
  */
46
62
  set autolinkUrls(value) {
47
63
  wasm.wasmparseroptions_set_autolink_urls(this.__wbg_ptr, value);
48
64
  }
49
65
  /**
66
+ * Enables GFM autolinks in the parser.
67
+ *
68
+ * Default: `false`.
50
69
  * @param {boolean} value
51
70
  */
52
71
  set autolinks(value) {
53
72
  wasm.wasmparseroptions_set_autolinks(this.__wbg_ptr, value);
54
73
  }
55
74
  /**
75
+ * Enables footnote references and definitions.
76
+ *
77
+ * Default: `false`.
56
78
  * @param {boolean} value
57
79
  */
58
80
  set footnotes(value) {
59
81
  wasm.wasmparseroptions_set_footnotes(this.__wbg_ptr, value);
60
82
  }
61
83
  /**
84
+ * Enables the GFM convenience profile.
85
+ *
86
+ * Default: `false`.
62
87
  * @param {boolean} value
63
88
  */
64
89
  set gfm(value) {
65
90
  wasm.wasmparseroptions_set_gfm(this.__wbg_ptr, value);
66
91
  }
67
92
  /**
93
+ * Enables GFM strikethrough spans.
94
+ *
95
+ * Default: `false`.
68
96
  * @param {boolean} value
69
97
  */
70
98
  set strikethrough(value) {
71
99
  wasm.wasmparseroptions_set_strikethrough(this.__wbg_ptr, value);
72
100
  }
73
101
  /**
102
+ * Enables GFM pipe tables.
103
+ *
104
+ * Default: `false`.
74
105
  * @param {boolean} value
75
106
  */
76
107
  set tables(value) {
77
108
  wasm.wasmparseroptions_set_tables(this.__wbg_ptr, value);
78
109
  }
79
110
  /**
111
+ * Enables GFM task-list item markers such as `- [x]`.
112
+ *
113
+ * Default: `false`.
80
114
  * @param {boolean} value
81
115
  */
82
116
  set taskLists(value) {
83
117
  wasm.wasmparseroptions_set_task_lists(this.__wbg_ptr, value);
84
118
  }
85
119
  /**
120
+ * Sets the maximum heading depth included in inline TOCs.
121
+ *
122
+ * Default: `3`.
86
123
  * @param {number} value
87
124
  */
88
125
  set tocMaxDepth(value) {
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ox-content/wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for Ox Content - Browser-ready Markdown parser",
5
- "version": "2.67.0",
5
+ "version": "2.69.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",