From b9fe138b2dbb426db107cad69c72de1d027d60fe Mon Sep 17 00:00:00 2001 From: "Daum Alexander (DCL ATV SC D RAD CSFW FW)" Date: Mon, 6 May 2024 14:34:28 +0200 Subject: [PATCH] Don't add newlines in included files --- plantuml_markdown/plantuml_markdown.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plantuml_markdown/plantuml_markdown.py b/plantuml_markdown/plantuml_markdown.py index bbb04f6..c5ce31f 100644 --- a/plantuml_markdown/plantuml_markdown.py +++ b/plantuml_markdown/plantuml_markdown.py @@ -553,9 +553,9 @@ def _readFileRec(self, lines: List[str], directory: str) -> List[str]: if match: # variable definition, save the mapping as the value can be used in !include directives self._definitions[match.group('varname')] = match.group('value') - result.append(line) + result.append(line_striped) elif line_striped.startswith("!include"): - result.append(self._readInclLine(line_striped, directory)) + result.append(self._readInclLine(line_striped, directory).strip()) elif line_striped.startswith("@start"): # remove startuml as plantuml POST method doesn't like it in include files # we will wrap the whole combined text between start and end tags at the end @@ -566,7 +566,7 @@ def _readFileRec(self, lines: List[str], directory: str) -> List[str]: # we will wrap the whole combined text between start and end tags at the end continue else: - result.append(line) + result.append(line_striped) return result