diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-16 01:05:20 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-17 19:36:44 +0200 |
commit | a5ff70c21db1015a35c1aed37c8454639339ed1d (patch) | |
tree | c97a1633fae2e15880073fc0e326d4a318ca9adb | |
parent | 208de253c54c10e041fee1899bd2f8cbbff5c17d (diff) |
scripts: Support multi-paragraph comments in HTML output for tasks
When a comment contains multiple paragraphs, delimited by two or more
consecutive newline characters, render them in <p> elements. This
increases readability of the output.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
-rwxr-xr-x | scripts/html_task.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/html_task.py b/scripts/html_task.py index 596b43b..1e6c175 100755 --- a/scripts/html_task.py +++ b/scripts/html_task.py @@ -163,7 +163,13 @@ class periject_html(html_base.myhtml): "target":"_blank"}) comment = str.string[:str.start()] + a.text(str.group()) + str.string[str.end():] - html("li").print(comment) + comment = re.split(r'\n\n+', comment) + if len(comment) > 1: + with html("li"): + for para in comment: + html("p").print(para) + else: + html("li").print(comment[0]) #-------------------- # print |