@ox-content/wasm 3.0.0-beta.8 → 3.0.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.
@@ -15,88 +15,90 @@ export class WasmParserOptions {
15
15
  *
16
16
  * Defaults: `gfm = false`, `mdx = false`, `tocMaxDepth = 3`, `autolinkUrls = true`,
17
17
  * `autolinkPatterns = ["http://", "https://"]`,
18
- * `autolinkTargetBlank = true`, and `semanticFootnotes = false`.
18
+ * `autolinkTargetBlank = true`, `linkTargetBlank = true`,
19
+ * `sourceSpans = false`, `semanticFootnotes = false`, and the non-GFM
20
+ * Markdown extensions (`superscript`, `subscript`, `smartPunctuation`,
21
+ * `math`, and `definitionLists`) disabled.
19
22
  */
20
23
  constructor();
21
24
  /**
22
- * Replaces the URL prefix patterns used by auto-linking. Pass a JS
23
- * array of strings such as `["http://", "https://", "ftp://"]`.
24
- *
25
- * Default: `["http://", "https://"]`.
25
+ * Replaces the URL prefix patterns used by auto-linking.
26
26
  */
27
27
  set autolinkPatterns(value: string[]);
28
28
  /**
29
- * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked
30
- * URLs. Has no effect when `autolinkUrls` is off.
31
- *
32
- * Default: `true`.
29
+ * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked URLs.
33
30
  */
34
31
  set autolinkTargetBlank(value: boolean);
35
32
  /**
36
- * Enables the renderer's URL auto-linking builtin. Bare URLs matching
37
- * any registered pattern are wrapped in an `<a>` tag.
38
- *
39
- * Default: `false`.
33
+ * Enables the renderer's URL auto-linking builtin.
40
34
  */
41
35
  set autolinkUrls(value: boolean);
42
36
  /**
43
37
  * Enables GFM autolinks in the parser.
44
- *
45
- * Default: unset — follows the `gfm` profile (`false` without it).
46
38
  */
47
39
  set autolinks(value: boolean);
40
+ /**
41
+ * Enables definition list blocks.
42
+ */
43
+ set definitionLists(value: boolean);
48
44
  /**
49
45
  * Enables footnote references and definitions.
50
- *
51
- * Default: unset — follows the `gfm` profile (`false` without it).
52
46
  */
53
47
  set footnotes(value: boolean);
54
48
  /**
55
49
  * Enables the GFM convenience profile.
56
- *
57
- * Default: `true`.
58
50
  */
59
51
  set gfm(value: boolean);
60
52
  /**
61
- * Appends a visible heading permalink (`<a class="header-anchor" href="#id">`).
62
- *
63
- * Default: `false`.
53
+ * Appends a visible heading permalink.
64
54
  */
65
55
  set headingPermalinks(value: boolean);
56
+ /**
57
+ * Toggles `target="_blank" rel="noopener noreferrer"` on parsed Markdown links.
58
+ */
59
+ set linkTargetBlank(value: boolean);
60
+ /**
61
+ * Enables `$...$` inline math and `$$...$$` block math.
62
+ */
63
+ set math(value: boolean);
66
64
  /**
67
65
  * Enables MDX JSX, ESM, and expression nodes.
68
- *
69
- * Default: `false`.
70
66
  */
71
67
  set mdx(value: boolean);
72
68
  /**
73
69
  * Renders footnotes as a semantic ordered section with numeric markers.
74
- *
75
- * Default: `false`.
76
70
  */
77
71
  set semanticFootnotes(value: boolean);
72
+ /**
73
+ * Enables smart punctuation replacement.
74
+ */
75
+ set smartPunctuation(value: boolean);
76
+ /**
77
+ * Emits `data-source-span="start-end"` on rendered block elements.
78
+ */
79
+ set sourceSpans(value: boolean);
78
80
  /**
79
81
  * Enables GFM strikethrough spans.
80
- *
81
- * Default: unset — follows the `gfm` profile (`false` without it).
82
82
  */
83
83
  set strikethrough(value: boolean);
84
+ /**
85
+ * Enables `~text~` subscript spans.
86
+ */
87
+ set subscript(value: boolean);
88
+ /**
89
+ * Enables `^text^` superscript spans.
90
+ */
91
+ set superscript(value: boolean);
84
92
  /**
85
93
  * Enables GFM pipe tables.
86
- *
87
- * Default: unset — follows the `gfm` profile (`false` without it).
88
94
  */
89
95
  set tables(value: boolean);
90
96
  /**
91
97
  * Enables GFM task-list item markers such as `- [x]`.
92
- *
93
- * Default: unset — follows the `gfm` profile (`false` without it).
94
98
  */
95
99
  set taskLists(value: boolean);
96
100
  /**
97
101
  * Sets the maximum heading depth included in inline TOCs.
98
- *
99
- * Default: `3`.
100
102
  */
101
103
  set tocMaxDepth(value: number);
102
104
  }
@@ -129,12 +131,19 @@ export interface InitOutput {
129
131
  readonly wasmparseroptions_set_autolink_target_blank: (a: number, b: number) => void;
130
132
  readonly wasmparseroptions_set_autolink_urls: (a: number, b: number) => void;
131
133
  readonly wasmparseroptions_set_autolinks: (a: number, b: number) => void;
134
+ readonly wasmparseroptions_set_definition_lists: (a: number, b: number) => void;
132
135
  readonly wasmparseroptions_set_footnotes: (a: number, b: number) => void;
133
136
  readonly wasmparseroptions_set_gfm: (a: number, b: number) => void;
134
137
  readonly wasmparseroptions_set_heading_permalinks: (a: number, b: number) => void;
138
+ readonly wasmparseroptions_set_link_target_blank: (a: number, b: number) => void;
139
+ readonly wasmparseroptions_set_math: (a: number, b: number) => void;
135
140
  readonly wasmparseroptions_set_mdx: (a: number, b: number) => void;
136
141
  readonly wasmparseroptions_set_semantic_footnotes: (a: number, b: number) => void;
142
+ readonly wasmparseroptions_set_smart_punctuation: (a: number, b: number) => void;
143
+ readonly wasmparseroptions_set_source_spans: (a: number, b: number) => void;
137
144
  readonly wasmparseroptions_set_strikethrough: (a: number, b: number) => void;
145
+ readonly wasmparseroptions_set_subscript: (a: number, b: number) => void;
146
+ readonly wasmparseroptions_set_superscript: (a: number, b: number) => void;
138
147
  readonly wasmparseroptions_set_tables: (a: number, b: number) => void;
139
148
  readonly wasmparseroptions_set_task_lists: (a: number, b: number) => void;
140
149
  readonly wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
@@ -22,7 +22,10 @@ export class WasmParserOptions {
22
22
  *
23
23
  * Defaults: `gfm = false`, `mdx = false`, `tocMaxDepth = 3`, `autolinkUrls = true`,
24
24
  * `autolinkPatterns = ["http://", "https://"]`,
25
- * `autolinkTargetBlank = true`, and `semanticFootnotes = false`.
25
+ * `autolinkTargetBlank = true`, `linkTargetBlank = true`,
26
+ * `sourceSpans = false`, `semanticFootnotes = false`, and the non-GFM
27
+ * Markdown extensions (`superscript`, `subscript`, `smartPunctuation`,
28
+ * `math`, and `definitionLists`) disabled.
26
29
  */
27
30
  constructor() {
28
31
  const ret = wasm.wasmparseroptions_new();
@@ -31,10 +34,7 @@ export class WasmParserOptions {
31
34
  return this;
32
35
  }
33
36
  /**
34
- * Replaces the URL prefix patterns used by auto-linking. Pass a JS
35
- * array of strings such as `["http://", "https://", "ftp://"]`.
36
- *
37
- * Default: `["http://", "https://"]`.
37
+ * Replaces the URL prefix patterns used by auto-linking.
38
38
  * @param {string[]} value
39
39
  */
40
40
  set autolinkPatterns(value) {
@@ -43,20 +43,14 @@ export class WasmParserOptions {
43
43
  wasm.wasmparseroptions_set_autolink_patterns(this.__wbg_ptr, ptr0, len0);
44
44
  }
45
45
  /**
46
- * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked
47
- * URLs. Has no effect when `autolinkUrls` is off.
48
- *
49
- * Default: `true`.
46
+ * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked URLs.
50
47
  * @param {boolean} value
51
48
  */
52
49
  set autolinkTargetBlank(value) {
53
50
  wasm.wasmparseroptions_set_autolink_target_blank(this.__wbg_ptr, value);
54
51
  }
55
52
  /**
56
- * Enables the renderer's URL auto-linking builtin. Bare URLs matching
57
- * any registered pattern are wrapped in an `<a>` tag.
58
- *
59
- * Default: `false`.
53
+ * Enables the renderer's URL auto-linking builtin.
60
54
  * @param {boolean} value
61
55
  */
62
56
  set autolinkUrls(value) {
@@ -64,17 +58,20 @@ export class WasmParserOptions {
64
58
  }
65
59
  /**
66
60
  * Enables GFM autolinks in the parser.
67
- *
68
- * Default: unset — follows the `gfm` profile (`false` without it).
69
61
  * @param {boolean} value
70
62
  */
71
63
  set autolinks(value) {
72
64
  wasm.wasmparseroptions_set_autolinks(this.__wbg_ptr, value);
73
65
  }
66
+ /**
67
+ * Enables definition list blocks.
68
+ * @param {boolean} value
69
+ */
70
+ set definitionLists(value) {
71
+ wasm.wasmparseroptions_set_definition_lists(this.__wbg_ptr, value);
72
+ }
74
73
  /**
75
74
  * Enables footnote references and definitions.
76
- *
77
- * Default: unset — follows the `gfm` profile (`false` without it).
78
75
  * @param {boolean} value
79
76
  */
80
77
  set footnotes(value) {
@@ -82,26 +79,34 @@ export class WasmParserOptions {
82
79
  }
83
80
  /**
84
81
  * Enables the GFM convenience profile.
85
- *
86
- * Default: `true`.
87
82
  * @param {boolean} value
88
83
  */
89
84
  set gfm(value) {
90
85
  wasm.wasmparseroptions_set_gfm(this.__wbg_ptr, value);
91
86
  }
92
87
  /**
93
- * Appends a visible heading permalink (`<a class="header-anchor" href="#id">`).
94
- *
95
- * Default: `false`.
88
+ * Appends a visible heading permalink.
96
89
  * @param {boolean} value
97
90
  */
98
91
  set headingPermalinks(value) {
99
92
  wasm.wasmparseroptions_set_heading_permalinks(this.__wbg_ptr, value);
100
93
  }
94
+ /**
95
+ * Toggles `target="_blank" rel="noopener noreferrer"` on parsed Markdown links.
96
+ * @param {boolean} value
97
+ */
98
+ set linkTargetBlank(value) {
99
+ wasm.wasmparseroptions_set_link_target_blank(this.__wbg_ptr, value);
100
+ }
101
+ /**
102
+ * Enables `$...$` inline math and `$$...$$` block math.
103
+ * @param {boolean} value
104
+ */
105
+ set math(value) {
106
+ wasm.wasmparseroptions_set_math(this.__wbg_ptr, value);
107
+ }
101
108
  /**
102
109
  * Enables MDX JSX, ESM, and expression nodes.
103
- *
104
- * Default: `false`.
105
110
  * @param {boolean} value
106
111
  */
107
112
  set mdx(value) {
@@ -109,26 +114,48 @@ export class WasmParserOptions {
109
114
  }
110
115
  /**
111
116
  * Renders footnotes as a semantic ordered section with numeric markers.
112
- *
113
- * Default: `false`.
114
117
  * @param {boolean} value
115
118
  */
116
119
  set semanticFootnotes(value) {
117
120
  wasm.wasmparseroptions_set_semantic_footnotes(this.__wbg_ptr, value);
118
121
  }
122
+ /**
123
+ * Enables smart punctuation replacement.
124
+ * @param {boolean} value
125
+ */
126
+ set smartPunctuation(value) {
127
+ wasm.wasmparseroptions_set_smart_punctuation(this.__wbg_ptr, value);
128
+ }
129
+ /**
130
+ * Emits `data-source-span="start-end"` on rendered block elements.
131
+ * @param {boolean} value
132
+ */
133
+ set sourceSpans(value) {
134
+ wasm.wasmparseroptions_set_source_spans(this.__wbg_ptr, value);
135
+ }
119
136
  /**
120
137
  * Enables GFM strikethrough spans.
121
- *
122
- * Default: unset — follows the `gfm` profile (`false` without it).
123
138
  * @param {boolean} value
124
139
  */
125
140
  set strikethrough(value) {
126
141
  wasm.wasmparseroptions_set_strikethrough(this.__wbg_ptr, value);
127
142
  }
143
+ /**
144
+ * Enables `~text~` subscript spans.
145
+ * @param {boolean} value
146
+ */
147
+ set subscript(value) {
148
+ wasm.wasmparseroptions_set_subscript(this.__wbg_ptr, value);
149
+ }
150
+ /**
151
+ * Enables `^text^` superscript spans.
152
+ * @param {boolean} value
153
+ */
154
+ set superscript(value) {
155
+ wasm.wasmparseroptions_set_superscript(this.__wbg_ptr, value);
156
+ }
128
157
  /**
129
158
  * Enables GFM pipe tables.
130
- *
131
- * Default: unset — follows the `gfm` profile (`false` without it).
132
159
  * @param {boolean} value
133
160
  */
134
161
  set tables(value) {
@@ -136,8 +163,6 @@ export class WasmParserOptions {
136
163
  }
137
164
  /**
138
165
  * Enables GFM task-list item markers such as `- [x]`.
139
- *
140
- * Default: unset — follows the `gfm` profile (`false` without it).
141
166
  * @param {boolean} value
142
167
  */
143
168
  set taskLists(value) {
@@ -145,8 +170,6 @@ export class WasmParserOptions {
145
170
  }
146
171
  /**
147
172
  * Sets the maximum heading depth included in inline TOCs.
148
- *
149
- * Default: `3`.
150
173
  * @param {number} value
151
174
  */
152
175
  set tocMaxDepth(value) {
Binary file
@@ -10,12 +10,19 @@ export const wasmparseroptions_set_autolink_patterns: (a: number, b: number, c:
10
10
  export const wasmparseroptions_set_autolink_target_blank: (a: number, b: number) => void;
11
11
  export const wasmparseroptions_set_autolink_urls: (a: number, b: number) => void;
12
12
  export const wasmparseroptions_set_autolinks: (a: number, b: number) => void;
13
+ export const wasmparseroptions_set_definition_lists: (a: number, b: number) => void;
13
14
  export const wasmparseroptions_set_footnotes: (a: number, b: number) => void;
14
15
  export const wasmparseroptions_set_gfm: (a: number, b: number) => void;
15
16
  export const wasmparseroptions_set_heading_permalinks: (a: number, b: number) => void;
17
+ export const wasmparseroptions_set_link_target_blank: (a: number, b: number) => void;
18
+ export const wasmparseroptions_set_math: (a: number, b: number) => void;
16
19
  export const wasmparseroptions_set_mdx: (a: number, b: number) => void;
17
20
  export const wasmparseroptions_set_semantic_footnotes: (a: number, b: number) => void;
21
+ export const wasmparseroptions_set_smart_punctuation: (a: number, b: number) => void;
22
+ export const wasmparseroptions_set_source_spans: (a: number, b: number) => void;
18
23
  export const wasmparseroptions_set_strikethrough: (a: number, b: number) => void;
24
+ export const wasmparseroptions_set_subscript: (a: number, b: number) => void;
25
+ export const wasmparseroptions_set_superscript: (a: number, b: number) => void;
19
26
  export const wasmparseroptions_set_tables: (a: number, b: number) => void;
20
27
  export const wasmparseroptions_set_task_lists: (a: number, b: number) => void;
21
28
  export const wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
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": "3.0.0-beta.8",
5
+ "version": "3.0.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",