@buerokratt-ria/common-gui-components 0.0.11 → 0.0.12

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.12] - 22-04-2025
8
+
9
+ - Modified Markdowify Logic to handle the case only the list line ends with : followed by space
10
+
7
11
  ## [0.0.11] - 01-04-2025
8
12
 
9
13
  - Updated preference page loading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -41,6 +41,8 @@ const LinkPreview: React.FC<{
41
41
  );
42
42
  };
43
43
 
44
+ const hasSpecialFormat = (m: string) => m.includes("\n\n") && m.indexOf(".") > 0 && m.indexOf(":") > m.indexOf(".");
45
+
44
46
  const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = false }) => (
45
47
  <div className={"reset"}>
46
48
  <Markdown
@@ -58,10 +60,8 @@ const Markdownify: React.FC<MarkdownifyProps> = ({ message, sanitizeLinks = fals
58
60
  }}
59
61
  >
60
62
  {message
61
- ?.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) => {
62
- return String.fromCharCode(parseInt(hex, 16));
63
- })
64
- .replace(/(?<=\n)\d+\.\s/g, "\n\n$&") ?? ""}
63
+ ?.replace(/&#x([0-9A-Fa-f]+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))
64
+ ?.replace(/(?<=\n)\d+\.\s/g, hasSpecialFormat(message) ? "\n\n$&" : "$&") ?? ""}
65
65
  </Markdown>
66
66
  </div>
67
67
  );