@cloro-dev/response-parser 0.5.1 โ†’ 0.5.2

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/README.md +11 -4
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -10,7 +10,7 @@ A powerful TypeScript library for parsing AI model responses from ChatGPT, Gemin
10
10
  - ๐Ÿ” **Auto-Detection**: Automatically detects the AI provider from response structure
11
11
  - ๐ŸŽจ **Built-in Styling**: Provider-specific styling
12
12
  - ๐Ÿ”ง **Framework-Agnostic**: Pure HTML output for any framework
13
- - ๐Ÿ”’ **Secure**: Automatic script sanitization
13
+ - ๐Ÿงน **Script removal**: Removes `<script>` and `<noscript>` elements. This is not a full HTML sanitizer.
14
14
  - ๐Ÿ“ฆ **TypeScript**: Full TypeScript support with comprehensive types
15
15
  - ๐ŸŽฏ **Lightweight**: No runtime dependencies for core parsing
16
16
 
@@ -26,7 +26,9 @@ pnpm add @cloro-dev/response-parser
26
26
 
27
27
  ## Quick Start
28
28
 
29
- This library parses AI responses and returns sanitized HTML strings. You can render the HTML in any framework:
29
+ This library parses AI responses and returns HTML strings. You can render the HTML in any framework.
30
+
31
+ > **Security**: The parser removes only `<script>` and `<noscript>` elements. It does not remove event handler attributes (for example `onerror=`) or `javascript:` URLs. If the HTML comes from a source that you do not trust, sanitize `parsed.html` with a full HTML sanitizer (for example [DOMPurify](https://github.com/cure53/DOMPurify)) before you render it.
30
32
 
31
33
  ```typescript
32
34
  import { parseAiResponse, detectProvider } from "@cloro-dev/response-parser";
@@ -36,7 +38,7 @@ const response = await fetchAIResponse();
36
38
  const parsed = parseAiResponse(response);
37
39
 
38
40
  console.log(parsed.provider); // 'CHATGPT' | 'GEMINI' | etc.
39
- console.log(parsed.html); // Sanitized HTML ready for rendering
41
+ console.log(parsed.html); // HTML with <script> and <noscript> elements removed
40
42
  console.log(parsed.text); // Plain text version
41
43
  ```
42
44
 
@@ -236,6 +238,11 @@ The core parsing logic is identical - you just need to handle the HTML rendering
236
238
 
237
239
  ## What's Changed
238
240
 
241
+ ### v0.5.2
242
+
243
+ - โœ… **Fixed** The README said that the parser sanitizes HTML. It removes only `<script>` and `<noscript>` elements. A new Security note tells you to sanitize untrusted HTML before you render it
244
+ - โœ… **Fixed** The `package.json` repository URL now points to `cloro-dev/response-parser`
245
+
239
246
  ### v0.5.1
240
247
 
241
248
  - โœ… **Fixed** ChatGPT `removeSources` now hides the open sources dialog of the mobile page
@@ -306,7 +313,7 @@ The core parsing logic is identical - you just need to handle the HTML rendering
306
313
 
307
314
  ### v0.1.3
308
315
 
309
- - โœ… **Always sanitizes** HTML by default (removes scripts for security)
316
+ - โœ… **Always removes** `<script>` and `<noscript>` elements from the HTML
310
317
  - โœ… **Always includes** provider-specific styles
311
318
  - โœ… **Always uses** provider's base URL for relative links
312
319
  - โŒ **Removed** `theme` option (styles are provider-specific)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloro-dev/response-parser",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "description": "Parse and render AI model responses from ChatGPT, Gemini, Perplexity, and more",
6
6
  "main": "dist/index.cjs",
@@ -40,7 +40,7 @@
40
40
  "license": "MIT",
41
41
  "repository": {
42
42
  "type": "git",
43
- "url": "https://github.com/cloro/response-parser.git"
43
+ "url": "https://github.com/cloro-dev/response-parser.git"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@rollup/plugin-commonjs": "^25.0.7",