From c334b588d4ef35fbf30f076fd8f902925d0fa417 Mon Sep 17 00:00:00 2001
From: Philip Makedonski <makedonski@cs.uni-goettingen.de>
Date: Tue, 19 Dec 2023 21:01:27 +0100
Subject: [PATCH] + fix for spacing issues in TPD descriptions #63

---
 .../src/org/etsi/mts/tdl/tools/to/docx/poi/Generator.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plugins/org.etsi.mts.tdl.tools.to.docx.poi/src/org/etsi/mts/tdl/tools/to/docx/poi/Generator.java b/plugins/org.etsi.mts.tdl.tools.to.docx.poi/src/org/etsi/mts/tdl/tools/to/docx/poi/Generator.java
index aa04e46a..06650f48 100644
--- a/plugins/org.etsi.mts.tdl.tools.to.docx.poi/src/org/etsi/mts/tdl/tools/to/docx/poi/Generator.java
+++ b/plugins/org.etsi.mts.tdl.tools.to.docx.poi/src/org/etsi/mts/tdl/tools/to/docx/poi/Generator.java
@@ -426,8 +426,12 @@ public class Generator {
 		map.put(Placeholders.NAME, tpd.getName());
 		//TODO: what if 0? what if more than 1?
 		//TODO: make more robust
+		//DONE: remove formatting spaces?
 		if (tpd.getTestObjective().size() == 1) {
-			map.put(Placeholders.DESCRIPTION, tpd.getTestObjective().get(0).getDescription().replaceAll("\"", ""));
+			map.put(Placeholders.DESCRIPTION, tpd.getTestObjective().get(0).getDescription()
+					.replaceAll("\"", "")
+					.replaceAll("\\s*\n\\s+", " ")
+					);
 			String uri = String.join("\n", tpd.getTestObjective().get(0).getObjectiveURI()).trim();
 			map.put(Placeholders.URI, uri.replaceAll("\"",""));
 		} else {
-- 
GitLab