@aaronshaf/plane 0.1.10 → 0.1.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api.ts +16 -1
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.10",
6
+ "version": "0.1.11",
7
7
  "description": "CLI for the Plane project management API",
8
8
  "keywords": [
9
9
  "plane",
package/src/api.ts CHANGED
@@ -66,7 +66,22 @@ function request(
66
66
  // 204 No Content
67
67
  if (res.status === 204) return null;
68
68
 
69
- return res.json();
69
+ // Use text + lenient parse to handle bare control characters (U+0000–U+001F)
70
+ // that may appear inside JSON string values (e.g. description_html with \n in <pre>).
71
+ const text = await res.text();
72
+ try {
73
+ return JSON.parse(text);
74
+ } catch {
75
+ // Escape bare control characters inside JSON string values and retry.
76
+ const sanitized = text.replace(
77
+ /"(?:[^"\\]|\\.)*"/g,
78
+ (match) => match.replace(/[\x00-\x1F]/g, (c) => {
79
+ const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
80
+ return `\\u${hex}`;
81
+ }),
82
+ );
83
+ return JSON.parse(sanitized);
84
+ }
70
85
  },
71
86
  catch: (e) => (e instanceof Error ? e : new Error(String(e))),
72
87
  });