@visns-studio/visns-components 5.1.3 → 5.1.4
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/package.json
CHANGED
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
78
78
|
},
|
|
79
79
|
"name": "@visns-studio/visns-components",
|
|
80
|
-
"version": "5.1.
|
|
80
|
+
"version": "5.1.4",
|
|
81
81
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
82
82
|
"main": "src/index.js",
|
|
83
83
|
"files": [
|
|
@@ -520,16 +520,25 @@ function GenericDetail({
|
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
// Split the string on both '\n' and '<br>' using a regular expression.
|
|
523
|
-
|
|
523
|
+
// Also handles any additional whitespace around the line breaks.
|
|
524
|
+
const lines = truncatedValue
|
|
525
|
+
.split(/<br\s*\/?>|\n/)
|
|
526
|
+
.map((line) => line.trim());
|
|
524
527
|
|
|
525
528
|
if (lines.length === 0) {
|
|
526
529
|
return null;
|
|
527
530
|
}
|
|
528
531
|
|
|
532
|
+
console.info(lines);
|
|
533
|
+
|
|
529
534
|
return (
|
|
530
535
|
<>
|
|
531
536
|
{lines.map((line, index) => (
|
|
532
|
-
<
|
|
537
|
+
<React.Fragment key={index}>
|
|
538
|
+
{line}
|
|
539
|
+
{index < lines.length - 1 && <br />}{' '}
|
|
540
|
+
{/* Add <br /> between lines */}
|
|
541
|
+
</React.Fragment>
|
|
533
542
|
))}
|
|
534
543
|
</>
|
|
535
544
|
);
|