From d9d9051343c83d27d4237b1bc8badd6cb88387a6 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Nov 2024 12:18:26 +0200 Subject: [PATCH] Improve rendering of VM descriptions Render the description as a single paragraph, with preserved line breaks and word breaking on overflow. Fixes #1888, #1890. --- src/components/vm/vmDetailsPage.jsx | 6 +++--- src/machines.scss | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/vm/vmDetailsPage.jsx b/src/components/vm/vmDetailsPage.jsx index 3ccc62b3a..98c38a335 100644 --- a/src/components/vm/vmDetailsPage.jsx +++ b/src/components/vm/vmDetailsPage.jsx @@ -77,9 +77,9 @@ export const VmDetailsPage = ({ { vm.inactiveXML.description && -
- {vm.inactiveXML.description.split("\n").map((p, i) =>

{p}

)} -
+

+ {vm.inactiveXML.description} +

} ); diff --git a/src/machines.scss b/src/machines.scss index a4f6b4c7c..d0eeda2f0 100644 --- a/src/machines.scss +++ b/src/machines.scss @@ -102,3 +102,8 @@ #storage-pool-delete-modal span.pf-v5-c-check__body { margin-block-start: 0; } + +.vm-description { + white-space: pre-wrap; + overflow-wrap: break-word; +}