@buerokratt-ria/common-gui-components 0.0.35 → 0.0.36
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 +4 -0
- package/package.json +1 -1
- package/ui-components/Chat/Markdownify.tsx +10 -5
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.36] - 14.01.2026
|
|
8
|
+
|
|
9
|
+
- Hide $backoffice, $validate_ and $general_knowledge from end user
|
|
10
|
+
|
|
7
11
|
## [0.0.35] - 09.01.2026
|
|
8
12
|
|
|
9
13
|
- Fixed Pagination on date change
|
package/package.json
CHANGED
|
@@ -46,10 +46,15 @@ const hasSpecialFormat = (m: string) => m.includes("\n\n") && m.indexOf(".") > 0
|
|
|
46
46
|
function formatMessage(message?: string): string {
|
|
47
47
|
if (!message) return "";
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
.
|
|
51
|
-
.
|
|
52
|
-
|
|
49
|
+
const filteredMessage = message
|
|
50
|
+
.replaceAll(/\\?\$b\w*/g, "")
|
|
51
|
+
.replaceAll(/\\?\$v\w*/g, "")
|
|
52
|
+
.replaceAll(/\\?\$g\w*/g, "");
|
|
53
|
+
|
|
54
|
+
return filteredMessage
|
|
55
|
+
.replaceAll(/&#x([0-9A-Fa-f]+);/g, (_, hex: string) => String.fromCharCode(parseInt(hex, 16)))
|
|
56
|
+
.replaceAll(/(^|\n)(\d{4})\.\s/g, (match, prefix, year) => {
|
|
57
|
+
const remainingText = filteredMessage.substring(filteredMessage.indexOf(match) + match.length);
|
|
53
58
|
const sentenceEnd = remainingText.indexOf("\n\n");
|
|
54
59
|
if (sentenceEnd !== -1) {
|
|
55
60
|
const currentSentence = remainingText.substring(0, sentenceEnd);
|
|
@@ -59,7 +64,7 @@ function formatMessage(message?: string): string {
|
|
|
59
64
|
}
|
|
60
65
|
return `${prefix}${year}\\. `;
|
|
61
66
|
})
|
|
62
|
-
.replace(/(?<=\n)\d+\.\s/g, hasSpecialFormat(
|
|
67
|
+
.replace(/(?<=\n)\d+\.\s/g, hasSpecialFormat(filteredMessage) ? "\n\n$&" : "$&");
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = false }) => (
|