rumdl-wasm 0.1.79 → 0.1.81

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  "Ruben J. Jongejan <ruben.jongejan@gmail.com>"
6
6
  ],
7
7
  "description": "Fast markdown linter with 60+ rules - WebAssembly build",
8
- "version": "0.1.79",
8
+ "version": "0.1.81",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/rumdl_lib.d.ts CHANGED
@@ -13,6 +13,12 @@ export class Linter {
13
13
  /**
14
14
  * Lint markdown content and return warnings as JSON
15
15
  *
16
+ * # Arguments
17
+ * * `content` - Markdown content to lint
18
+ * * `path` - Optional file path (e.g. vault-relative). When provided, the
19
+ * path is matched against configured `exclude` patterns; excluded files
20
+ * return `"[]"` without linting.
21
+ *
16
22
  * Returns a JSON array of warnings, each with:
17
23
  * - `rule_name`: Rule name (e.g., "MD001")
18
24
  * - `message`: Warning message
@@ -23,13 +29,18 @@ export class Linter {
23
29
  * Note: Fix ranges use character offsets (not byte offsets) for JavaScript compatibility.
24
30
  * This is important for multi-byte UTF-8 characters like `æ` or emoji.
25
31
  */
26
- check(content: string): string;
32
+ check(content: string, path?: string | null): string;
27
33
  /**
28
34
  * Apply all auto-fixes to the content and return the fixed content
29
35
  *
36
+ * # Arguments
37
+ * * `content` - Markdown content to fix
38
+ * * `path` - Optional file path. When provided and matching an `exclude`
39
+ * pattern, the content is returned unchanged.
40
+ *
30
41
  * Uses the same fix coordinator as the CLI for consistent behavior.
31
42
  */
32
- fix(content: string): string;
43
+ fix(content: string, path?: string | null): string;
33
44
  /**
34
45
  * Get the current configuration as JSON
35
46
  *
@@ -90,8 +101,8 @@ export interface InitOutput {
90
101
  readonly __wbg_linter_free: (a: number, b: number) => void;
91
102
  readonly get_available_rules: (a: number) => void;
92
103
  readonly get_version: (a: number) => void;
93
- readonly linter_check: (a: number, b: number, c: number, d: number) => void;
94
- readonly linter_fix: (a: number, b: number, c: number, d: number) => void;
104
+ readonly linter_check: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
105
+ readonly linter_fix: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
95
106
  readonly linter_get_config: (a: number, b: number) => void;
96
107
  readonly linter_get_config_warnings: (a: number, b: number) => void;
97
108
  readonly linter_new: (a: number, b: number) => void;
package/rumdl_lib.js CHANGED
@@ -20,6 +20,12 @@ export class Linter {
20
20
  /**
21
21
  * Lint markdown content and return warnings as JSON
22
22
  *
23
+ * # Arguments
24
+ * * `content` - Markdown content to lint
25
+ * * `path` - Optional file path (e.g. vault-relative). When provided, the
26
+ * path is matched against configured `exclude` patterns; excluded files
27
+ * return `"[]"` without linting.
28
+ *
23
29
  * Returns a JSON array of warnings, each with:
24
30
  * - `rule_name`: Rule name (e.g., "MD001")
25
31
  * - `message`: Warning message
@@ -30,49 +36,60 @@ export class Linter {
30
36
  * Note: Fix ranges use character offsets (not byte offsets) for JavaScript compatibility.
31
37
  * This is important for multi-byte UTF-8 characters like `æ` or emoji.
32
38
  * @param {string} content
39
+ * @param {string | null} [path]
33
40
  * @returns {string}
34
41
  */
35
- check(content) {
36
- let deferred2_0;
37
- let deferred2_1;
42
+ check(content, path) {
43
+ let deferred3_0;
44
+ let deferred3_1;
38
45
  try {
39
46
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
40
47
  const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
41
48
  const len0 = WASM_VECTOR_LEN;
42
- wasm.linter_check(retptr, this.__wbg_ptr, ptr0, len0);
49
+ var ptr1 = isLikeNone(path) ? 0 : passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
50
+ var len1 = WASM_VECTOR_LEN;
51
+ wasm.linter_check(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
43
52
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
44
53
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
45
- deferred2_0 = r0;
46
- deferred2_1 = r1;
54
+ deferred3_0 = r0;
55
+ deferred3_1 = r1;
47
56
  return getStringFromWasm0(r0, r1);
48
57
  } finally {
49
58
  wasm.__wbindgen_add_to_stack_pointer(16);
50
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
59
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
51
60
  }
52
61
  }
53
62
  /**
54
63
  * Apply all auto-fixes to the content and return the fixed content
55
64
  *
65
+ * # Arguments
66
+ * * `content` - Markdown content to fix
67
+ * * `path` - Optional file path. When provided and matching an `exclude`
68
+ * pattern, the content is returned unchanged.
69
+ *
56
70
  * Uses the same fix coordinator as the CLI for consistent behavior.
57
71
  * @param {string} content
72
+ * @param {string | null} [path]
58
73
  * @returns {string}
59
74
  */
60
- fix(content) {
61
- let deferred2_0;
62
- let deferred2_1;
75
+ fix(content, path) {
76
+ let deferred3_0;
77
+ let deferred3_1;
63
78
  try {
64
79
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
65
80
  const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
66
81
  const len0 = WASM_VECTOR_LEN;
67
- wasm.linter_fix(retptr, this.__wbg_ptr, ptr0, len0);
82
+ var ptr1 = isLikeNone(path) ? 0 : passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
83
+ var len1 = WASM_VECTOR_LEN;
84
+ wasm.linter_fix(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
68
85
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
69
86
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
70
- deferred2_0 = r0;
71
- deferred2_1 = r1;
87
+ deferred3_0 = r0;
88
+ deferred3_1 = r1;
72
89
  return getStringFromWasm0(r0, r1);
73
90
  } finally {
74
91
  wasm.__wbindgen_add_to_stack_pointer(16);
75
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
92
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
76
93
  }
77
94
  }
78
95
  /**
package/rumdl_lib_bg.wasm CHANGED
Binary file