Skip to content

Commit 46e7f71

Browse files
committed
segenxml.py: Strip extra whitespace from summary stanzas.
The desc stanzas are meant to be formatted, but summary are not. Remove extra whitespace. Signed-off-by: Chris PeBenito <pebenito@ieee.org>
1 parent 881916b commit 46e7f71

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

support/segenxml.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ def get_policy_xml(layer_dirs: list[str], policy_files: list[str], tunable_file:
287287
policy_elem.extend(boolean_xml)
288288
warn_count += boolean_warns
289289

290+
for summary_elem in policy_elem.iter("summary"):
291+
assert summary_elem.text is not None, "summary element text should not be None. segenxml.py bug."
292+
summary_elem.text = re.sub(r"\s+", " ", summary_elem.text).strip()
293+
290294
return policy_elem, warn_count
291295

292296

0 commit comments

Comments
 (0)