From 7292e0ef370b53d3fe7dafed18d9078810e412ac Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 2 Dec 2019 16:44:57 +0100 Subject: [PATCH] fix newline handling --- ansibledoctor/Annotation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ansibledoctor/Annotation.py b/ansibledoctor/Annotation.py index d1816dc..140901b 100644 --- a/ansibledoctor/Annotation.py +++ b/ansibledoctor/Annotation.py @@ -139,7 +139,11 @@ class Annotation: self._file_handler.seek(current_file_position) break - final = newline + next_line.replace("#", "").rstrip() + final = next_line.replace("#", "").rstrip() + if final[:1] == " ": + final = final[1:] + final = newline + final + # match if empty line or commented empty line test_line = next_line.replace("#", "").strip() if len(test_line) == 0: @@ -147,7 +151,7 @@ class Annotation: continue else: newline = "" - print(final) + multiline.append(newline + final) if parts[2].startswith("$"):