@ox-content/wasm 2.16.0 → 2.25.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.
@@ -8,6 +8,21 @@ export class WasmParserOptions {
8
8
  free(): void;
9
9
  [Symbol.dispose](): void;
10
10
  constructor();
11
+ /**
12
+ * Replaces the URL prefix patterns used by auto-linking. Pass a JS
13
+ * array of strings such as `["http://", "https://", "ftp://"]`.
14
+ */
15
+ set autolinkPatterns(value: string[]);
16
+ /**
17
+ * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked
18
+ * URLs. Has no effect when `autolinkUrls` is off.
19
+ */
20
+ set autolinkTargetBlank(value: boolean);
21
+ /**
22
+ * Enables the renderer's URL auto-linking builtin. Bare URLs matching
23
+ * any registered pattern are wrapped in an `<a>` tag.
24
+ */
25
+ set autolinkUrls(value: boolean);
11
26
  set autolinks(value: boolean);
12
27
  set footnotes(value: boolean);
13
28
  set gfm(value: boolean);
@@ -41,6 +56,9 @@ export interface InitOutput {
41
56
  readonly transform: (a: number, b: number, c: number) => number;
42
57
  readonly version: (a: number) => void;
43
58
  readonly wasmparseroptions_new: () => number;
59
+ readonly wasmparseroptions_set_autolink_patterns: (a: number, b: number, c: number) => void;
60
+ readonly wasmparseroptions_set_autolink_target_blank: (a: number, b: number) => void;
61
+ readonly wasmparseroptions_set_autolink_urls: (a: number, b: number) => void;
44
62
  readonly wasmparseroptions_set_autolinks: (a: number, b: number) => void;
45
63
  readonly wasmparseroptions_set_footnotes: (a: number, b: number) => void;
46
64
  readonly wasmparseroptions_set_gfm: (a: number, b: number) => void;
@@ -20,6 +20,32 @@ export class WasmParserOptions {
20
20
  WasmParserOptionsFinalization.register(this, this.__wbg_ptr, this);
21
21
  return this;
22
22
  }
23
+ /**
24
+ * Replaces the URL prefix patterns used by auto-linking. Pass a JS
25
+ * array of strings such as `["http://", "https://", "ftp://"]`.
26
+ * @param {string[]} value
27
+ */
28
+ set autolinkPatterns(value) {
29
+ const ptr0 = passArrayJsValueToWasm0(value, wasm.__wbindgen_export);
30
+ const len0 = WASM_VECTOR_LEN;
31
+ wasm.wasmparseroptions_set_autolink_patterns(this.__wbg_ptr, ptr0, len0);
32
+ }
33
+ /**
34
+ * Toggles `target="_blank" rel="noopener noreferrer"` on auto-linked
35
+ * URLs. Has no effect when `autolinkUrls` is off.
36
+ * @param {boolean} value
37
+ */
38
+ set autolinkTargetBlank(value) {
39
+ wasm.wasmparseroptions_set_autolink_target_blank(this.__wbg_ptr, value);
40
+ }
41
+ /**
42
+ * Enables the renderer's URL auto-linking builtin. Bare URLs matching
43
+ * any registered pattern are wrapped in an `<a>` tag.
44
+ * @param {boolean} value
45
+ */
46
+ set autolinkUrls(value) {
47
+ wasm.wasmparseroptions_set_autolink_urls(this.__wbg_ptr, value);
48
+ }
23
49
  /**
24
50
  * @param {boolean} value
25
51
  */
@@ -132,6 +158,14 @@ function __wbg_get_imports() {
132
158
  const ret = typeof(getObject(arg0)) === 'string';
133
159
  return ret;
134
160
  },
161
+ __wbg___wbindgen_string_get_72bdf95d3ae505b1: function(arg0, arg1) {
162
+ const obj = getObject(arg1);
163
+ const ret = typeof(obj) === 'string' ? obj : undefined;
164
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
165
+ var len1 = WASM_VECTOR_LEN;
166
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
167
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
168
+ },
135
169
  __wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
136
170
  throw new Error(getStringFromWasm0(arg0, arg1));
137
171
  },
@@ -247,6 +281,16 @@ function isLikeNone(x) {
247
281
  return x === undefined || x === null;
248
282
  }
249
283
 
284
+ function passArrayJsValueToWasm0(array, malloc) {
285
+ const ptr = malloc(array.length * 4, 4) >>> 0;
286
+ const mem = getDataViewMemory0();
287
+ for (let i = 0; i < array.length; i++) {
288
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
289
+ }
290
+ WASM_VECTOR_LEN = array.length;
291
+ return ptr;
292
+ }
293
+
250
294
  function passStringToWasm0(arg, malloc, realloc) {
251
295
  if (realloc === undefined) {
252
296
  const buf = cachedTextEncoder.encode(arg);
Binary file
@@ -6,6 +6,9 @@ export const parseAndRender: (a: number, b: number, c: number) => number;
6
6
  export const transform: (a: number, b: number, c: number) => number;
7
7
  export const version: (a: number) => void;
8
8
  export const wasmparseroptions_new: () => number;
9
+ export const wasmparseroptions_set_autolink_patterns: (a: number, b: number, c: number) => void;
10
+ export const wasmparseroptions_set_autolink_target_blank: (a: number, b: number) => void;
11
+ export const wasmparseroptions_set_autolink_urls: (a: number, b: number) => void;
9
12
  export const wasmparseroptions_set_autolinks: (a: number, b: number) => void;
10
13
  export const wasmparseroptions_set_footnotes: (a: number, b: number) => void;
11
14
  export const wasmparseroptions_set_gfm: (a: number, b: number) => void;
package/package.json CHANGED
@@ -2,11 +2,11 @@
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.16.0",
5
+ "version": "2.25.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/ubugeeei/ox-content.git",
9
+ "url": "https://github.com/ubugeeei-prod/ox-content.git",
10
10
  "directory": "crates/ox_content_wasm"
11
11
  },
12
12
  "files": [
@@ -16,7 +16,7 @@
16
16
  "ox_content_wasm_bg.wasm.d.ts"
17
17
  ],
18
18
  "main": "ox_content_wasm.js",
19
- "homepage": "https://ubugeeei.github.io/ox-content/packages/wasm",
19
+ "homepage": "https://ubugeeei-prod.github.io/ox-content/packages/wasm",
20
20
  "types": "ox_content_wasm.d.ts",
21
21
  "sideEffects": [
22
22
  "./snippets/*"
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "author": "ubugeeei",
34
34
  "bugs": {
35
- "url": "https://github.com/ubugeeei/ox-content/issues"
35
+ "url": "https://github.com/ubugeeei-prod/ox-content/issues"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"