@ox-content/wasm 3.0.0-beta.9 → 3.1.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,90 +15,100 @@ 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
+ * Enables Pandoc-style `{#id .class}` heading attribute blocks.
54
+ */
55
+ set headingAttributes(value: boolean);
56
+ /**
57
+ * Appends a visible heading permalink.
64
58
  */
65
59
  set headingPermalinks(value: boolean);
60
+ /**
61
+ * Toggles `target="_blank" rel="noopener noreferrer"` on parsed Markdown links.
62
+ */
63
+ set linkTargetBlank(value: boolean);
64
+ /**
65
+ * Enables `$...$` inline math and `$$...$$` block math.
66
+ */
67
+ set math(value: boolean);
66
68
  /**
67
69
  * Enables MDX JSX, ESM, and expression nodes.
68
- *
69
- * Default: `false`.
70
70
  */
71
71
  set mdx(value: boolean);
72
72
  /**
73
73
  * Renders footnotes as a semantic ordered section with numeric markers.
74
- *
75
- * Default: `false`.
76
74
  */
77
75
  set semanticFootnotes(value: boolean);
76
+ /**
77
+ * Enables smart punctuation replacement.
78
+ */
79
+ set smartPunctuation(value: boolean);
80
+ /**
81
+ * Emits `data-source-span="start-end"` on rendered block elements.
82
+ */
83
+ set sourceSpans(value: boolean);
78
84
  /**
79
85
  * Enables GFM strikethrough spans.
80
- *
81
- * Default: unset — follows the `gfm` profile (`false` without it).
82
86
  */
83
87
  set strikethrough(value: boolean);
88
+ /**
89
+ * Enables `~text~` subscript spans.
90
+ */
91
+ set subscript(value: boolean);
92
+ /**
93
+ * Enables `^text^` superscript spans.
94
+ */
95
+ set superscript(value: boolean);
84
96
  /**
85
97
  * Enables GFM pipe tables.
86
- *
87
- * Default: unset — follows the `gfm` profile (`false` without it).
88
98
  */
89
99
  set tables(value: boolean);
90
100
  /**
91
101
  * Enables GFM task-list item markers such as `- [x]`.
92
- *
93
- * Default: unset — follows the `gfm` profile (`false` without it).
94
102
  */
95
103
  set taskLists(value: boolean);
96
104
  /**
97
105
  * Sets the maximum heading depth included in inline TOCs.
98
- *
99
- * Default: `3`.
100
106
  */
101
107
  set tocMaxDepth(value: number);
108
+ /**
109
+ * Enables Obsidian-style wiki links as link nodes.
110
+ */
111
+ set wikiLinks(value: boolean);
102
112
  }
103
113
 
104
114
  /**
@@ -129,15 +139,24 @@ export interface InitOutput {
129
139
  readonly wasmparseroptions_set_autolink_target_blank: (a: number, b: number) => void;
130
140
  readonly wasmparseroptions_set_autolink_urls: (a: number, b: number) => void;
131
141
  readonly wasmparseroptions_set_autolinks: (a: number, b: number) => void;
142
+ readonly wasmparseroptions_set_definition_lists: (a: number, b: number) => void;
132
143
  readonly wasmparseroptions_set_footnotes: (a: number, b: number) => void;
133
144
  readonly wasmparseroptions_set_gfm: (a: number, b: number) => void;
145
+ readonly wasmparseroptions_set_heading_attributes: (a: number, b: number) => void;
134
146
  readonly wasmparseroptions_set_heading_permalinks: (a: number, b: number) => void;
147
+ readonly wasmparseroptions_set_link_target_blank: (a: number, b: number) => void;
148
+ readonly wasmparseroptions_set_math: (a: number, b: number) => void;
135
149
  readonly wasmparseroptions_set_mdx: (a: number, b: number) => void;
136
150
  readonly wasmparseroptions_set_semantic_footnotes: (a: number, b: number) => void;
151
+ readonly wasmparseroptions_set_smart_punctuation: (a: number, b: number) => void;
152
+ readonly wasmparseroptions_set_source_spans: (a: number, b: number) => void;
137
153
  readonly wasmparseroptions_set_strikethrough: (a: number, b: number) => void;
154
+ readonly wasmparseroptions_set_subscript: (a: number, b: number) => void;
155
+ readonly wasmparseroptions_set_superscript: (a: number, b: number) => void;
138
156
  readonly wasmparseroptions_set_tables: (a: number, b: number) => void;
139
157
  readonly wasmparseroptions_set_task_lists: (a: number, b: number) => void;
140
158
  readonly wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
159
+ readonly wasmparseroptions_set_wiki_links: (a: number, b: number) => void;
141
160
  readonly __wbindgen_export: (a: number, b: number) => number;
142
161
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
143
162
  readonly __wbindgen_export3: (a: 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,41 @@ 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
+ * Enables Pandoc-style `{#id .class}` heading attribute blocks.
89
+ * @param {boolean} value
90
+ */
91
+ set headingAttributes(value) {
92
+ wasm.wasmparseroptions_set_heading_attributes(this.__wbg_ptr, value);
93
+ }
94
+ /**
95
+ * Appends a visible heading permalink.
96
96
  * @param {boolean} value
97
97
  */
98
98
  set headingPermalinks(value) {
99
99
  wasm.wasmparseroptions_set_heading_permalinks(this.__wbg_ptr, value);
100
100
  }
101
+ /**
102
+ * Toggles `target="_blank" rel="noopener noreferrer"` on parsed Markdown links.
103
+ * @param {boolean} value
104
+ */
105
+ set linkTargetBlank(value) {
106
+ wasm.wasmparseroptions_set_link_target_blank(this.__wbg_ptr, value);
107
+ }
108
+ /**
109
+ * Enables `$...$` inline math and `$$...$$` block math.
110
+ * @param {boolean} value
111
+ */
112
+ set math(value) {
113
+ wasm.wasmparseroptions_set_math(this.__wbg_ptr, value);
114
+ }
101
115
  /**
102
116
  * Enables MDX JSX, ESM, and expression nodes.
103
- *
104
- * Default: `false`.
105
117
  * @param {boolean} value
106
118
  */
107
119
  set mdx(value) {
@@ -109,26 +121,48 @@ export class WasmParserOptions {
109
121
  }
110
122
  /**
111
123
  * Renders footnotes as a semantic ordered section with numeric markers.
112
- *
113
- * Default: `false`.
114
124
  * @param {boolean} value
115
125
  */
116
126
  set semanticFootnotes(value) {
117
127
  wasm.wasmparseroptions_set_semantic_footnotes(this.__wbg_ptr, value);
118
128
  }
129
+ /**
130
+ * Enables smart punctuation replacement.
131
+ * @param {boolean} value
132
+ */
133
+ set smartPunctuation(value) {
134
+ wasm.wasmparseroptions_set_smart_punctuation(this.__wbg_ptr, value);
135
+ }
136
+ /**
137
+ * Emits `data-source-span="start-end"` on rendered block elements.
138
+ * @param {boolean} value
139
+ */
140
+ set sourceSpans(value) {
141
+ wasm.wasmparseroptions_set_source_spans(this.__wbg_ptr, value);
142
+ }
119
143
  /**
120
144
  * Enables GFM strikethrough spans.
121
- *
122
- * Default: unset — follows the `gfm` profile (`false` without it).
123
145
  * @param {boolean} value
124
146
  */
125
147
  set strikethrough(value) {
126
148
  wasm.wasmparseroptions_set_strikethrough(this.__wbg_ptr, value);
127
149
  }
150
+ /**
151
+ * Enables `~text~` subscript spans.
152
+ * @param {boolean} value
153
+ */
154
+ set subscript(value) {
155
+ wasm.wasmparseroptions_set_subscript(this.__wbg_ptr, value);
156
+ }
157
+ /**
158
+ * Enables `^text^` superscript spans.
159
+ * @param {boolean} value
160
+ */
161
+ set superscript(value) {
162
+ wasm.wasmparseroptions_set_superscript(this.__wbg_ptr, value);
163
+ }
128
164
  /**
129
165
  * Enables GFM pipe tables.
130
- *
131
- * Default: unset — follows the `gfm` profile (`false` without it).
132
166
  * @param {boolean} value
133
167
  */
134
168
  set tables(value) {
@@ -136,8 +170,6 @@ export class WasmParserOptions {
136
170
  }
137
171
  /**
138
172
  * Enables GFM task-list item markers such as `- [x]`.
139
- *
140
- * Default: unset — follows the `gfm` profile (`false` without it).
141
173
  * @param {boolean} value
142
174
  */
143
175
  set taskLists(value) {
@@ -145,13 +177,18 @@ export class WasmParserOptions {
145
177
  }
146
178
  /**
147
179
  * Sets the maximum heading depth included in inline TOCs.
148
- *
149
- * Default: `3`.
150
180
  * @param {number} value
151
181
  */
152
182
  set tocMaxDepth(value) {
153
183
  wasm.wasmparseroptions_set_toc_max_depth(this.__wbg_ptr, value);
154
184
  }
185
+ /**
186
+ * Enables Obsidian-style wiki links as link nodes.
187
+ * @param {boolean} value
188
+ */
189
+ set wikiLinks(value) {
190
+ wasm.wasmparseroptions_set_wiki_links(this.__wbg_ptr, value);
191
+ }
155
192
  }
156
193
  if (Symbol.dispose) WasmParserOptions.prototype[Symbol.dispose] = WasmParserOptions.prototype.free;
157
194
 
Binary file
@@ -10,15 +10,24 @@ 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;
16
+ export const wasmparseroptions_set_heading_attributes: (a: number, b: number) => void;
15
17
  export const wasmparseroptions_set_heading_permalinks: (a: number, b: number) => void;
18
+ export const wasmparseroptions_set_link_target_blank: (a: number, b: number) => void;
19
+ export const wasmparseroptions_set_math: (a: number, b: number) => void;
16
20
  export const wasmparseroptions_set_mdx: (a: number, b: number) => void;
17
21
  export const wasmparseroptions_set_semantic_footnotes: (a: number, b: number) => void;
22
+ export const wasmparseroptions_set_smart_punctuation: (a: number, b: number) => void;
23
+ export const wasmparseroptions_set_source_spans: (a: number, b: number) => void;
18
24
  export const wasmparseroptions_set_strikethrough: (a: number, b: number) => void;
25
+ export const wasmparseroptions_set_subscript: (a: number, b: number) => void;
26
+ export const wasmparseroptions_set_superscript: (a: number, b: number) => void;
19
27
  export const wasmparseroptions_set_tables: (a: number, b: number) => void;
20
28
  export const wasmparseroptions_set_task_lists: (a: number, b: number) => void;
21
29
  export const wasmparseroptions_set_toc_max_depth: (a: number, b: number) => void;
30
+ export const wasmparseroptions_set_wiki_links: (a: number, b: number) => void;
22
31
  export const __wbindgen_export: (a: number, b: number) => number;
23
32
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
24
33
  export const __wbindgen_export3: (a: 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.9",
5
+ "version": "3.1.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",