@buerokratt-ria/common-gui-components 0.0.36 → 0.0.37

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All changes to this project will be documented in this file.
4
4
 
5
5
  ## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
6
6
 
7
+ ## [0.0.37] - 19.01.2026
8
+
9
+ - Added Sanitization to Markdownify
10
+
7
11
  ## [0.0.36] - 14.01.2026
8
12
 
9
13
  - Hide $backoffice, $validate_ and $general_knowledge from end user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -59,7 +59,9 @@
59
59
  "use-debounce": "^10.0.1",
60
60
  "usehooks-ts": "^2.9.1",
61
61
  "uuid": "^9.0.0",
62
- "zustand": "^4.4.4"
62
+ "zustand": "^4.4.4",
63
+ "sanitize-html": "^2.17.0",
64
+ "@types/sanitize-html": "^2.16.0"
63
65
  },
64
66
  "devDependencies": {
65
67
  "@buerokratt-ria/header": "^0.1.20",
@@ -118,6 +120,8 @@
118
120
  "@types/react": "^18.0.26",
119
121
  "@types/react-cookies": "^0.1.3",
120
122
  "@types/react-dom": "^18.0.9",
121
- "typescript": "^5.7.3"
123
+ "typescript": "^5.7.3",
124
+ "sanitize-html": "^2.17.0",
125
+ "@types/sanitize-html": "^2.16.0"
122
126
  }
123
127
  }
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import Markdown from "markdown-to-jsx";
3
- import "./Chat.scss";
3
+ import sanitizeHtml from "sanitize-html";
4
4
 
5
5
  interface MarkdownifyProps {
6
6
  message: string | undefined;
@@ -44,9 +44,11 @@ const LinkPreview: React.FC<{
44
44
  const hasSpecialFormat = (m: string) => m.includes("\n\n") && m.indexOf(".") > 0 && m.indexOf(":") > m.indexOf(".");
45
45
 
46
46
  function formatMessage(message?: string): string {
47
- if (!message) return "";
47
+ const sanitizedMessage = sanitizeHtml(message ?? "");
48
48
 
49
- const filteredMessage = message
49
+ if (!sanitizedMessage) return "";
50
+
51
+ const filteredMessage = sanitizedMessage
50
52
  .replaceAll(/\\?\$b\w*/g, "")
51
53
  .replaceAll(/\\?\$v\w*/g, "")
52
54
  .replaceAll(/\\?\$g\w*/g, "");