diff options
author | Thomas Haller <thaller@redhat.com> | 2022-10-04 12:12:51 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-10-06 13:40:29 +0200 |
commit | 8899ecc0d84744da19b5e1a686b89443d89ea42f (patch) | |
tree | b2bfd5d63246572ce844f67fe0e5a2cbc1d58649 /tools/generate-docs-nm-property-infos.py | |
parent | 8fc7b6df12edfdf9a4e74d2bc77853f2806618e8 (diff) | |
download | NetworkManager-8899ecc0d84744da19b5e1a686b89443d89ea42f.tar.gz |
tools: preserve newlines and indentation in "generate-docs-nm-property-infos.py"
Our docs can be long. It's important to be able to express paragraphs.
Honor a blank line to include a newline. For XML often whitespace is
ignored, but our tools can choose to honor the newline.
Also, don't strip the whitespace from the beginning and the end.
We keep whitespace for a certain indentation level, but additional
whitespace gets preserved. This is less important, because regular
spaces is indeed irrelevant. But when we write the annotations, we
should be in full control over spaces.
Diffstat (limited to 'tools/generate-docs-nm-property-infos.py')
-rwxr-xr-x | tools/generate-docs-nm-property-infos.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/generate-docs-nm-property-infos.py b/tools/generate-docs-nm-property-infos.py index 568bab17bc..93391c2e57 100755 --- a/tools/generate-docs-nm-property-infos.py +++ b/tools/generate-docs-nm-property-infos.py @@ -211,7 +211,7 @@ def parse_data(tag, line_no, lines): # No separator to add. This is a blank line pass else: - parsed_data[keyword] = parsed_data[keyword] + separator + text.strip() + parsed_data[keyword] = parsed_data[keyword] + separator + text if keywords[keyword] == KEYWORD_XML_TYPE_NESTED: # This is plain XML. They lines are joined by newlines. @@ -223,7 +223,7 @@ def parse_data(tag, line_no, lines): elif not text: # A blank line is used to mark a line break, while otherwise # lines are joined by space. - separator = " " + separator = "\n" else: separator = " " if "property" not in parsed_data: |