support multi-line notes and notes with complex formatting
Change-Id: Iedfe043ef3a166b075871f55148468ccebe94ea6
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Support note entries that span multiple lines using
|
||||||
|
preformatted syntax in YAML by prefixing the
|
||||||
|
list entry with ``|``.
|
||||||
|
|
||||||
|
For example::
|
||||||
|
|
||||||
|
- |
|
||||||
|
This entry has two paragraphs.
|
||||||
|
|
||||||
|
This is the second.
|
||||||
@@ -28,6 +28,18 @@ _SECTION_ORDER = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def _indent_for_list(text, prefix=' '):
|
||||||
|
"""Indent some text to make it work as a list entry.
|
||||||
|
|
||||||
|
Indent all lines except the first with the prefix.
|
||||||
|
"""
|
||||||
|
lines = text.splitlines()
|
||||||
|
return '\n'.join([lines[0]] + [
|
||||||
|
prefix + l
|
||||||
|
for l in lines[1:]
|
||||||
|
]) + '\n'
|
||||||
|
|
||||||
|
|
||||||
def format_report(reporoot, scanner_output, versions_to_include, title=None):
|
def format_report(reporoot, scanner_output, versions_to_include, title=None):
|
||||||
report = []
|
report = []
|
||||||
if title:
|
if title:
|
||||||
@@ -71,7 +83,7 @@ def format_report(reporoot, scanner_output, versions_to_include, title=None):
|
|||||||
report.append('-' * len(section_title))
|
report.append('-' * len(section_title))
|
||||||
report.append('')
|
report.append('')
|
||||||
for n in notes:
|
for n in notes:
|
||||||
report.append('- %s' % n)
|
report.append('- %s' % _indent_for_list(n))
|
||||||
report.append('')
|
report.append('')
|
||||||
|
|
||||||
return '\n'.join(report)
|
return '\n'.join(report)
|
||||||
|
|||||||
Reference in New Issue
Block a user