From cec00456818c6437de30cecc8c2bb0746a6cfb3c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 25 Aug 2023 10:11:31 +0100 Subject: [PATCH] shoving words "From here on duzznt go in du MoU" repeatedly into the bugtracker is going to get very irritating very quickly i said "just look for the standard markdown line-break which starts "--" --- src/budget_sync/main.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/budget_sync/main.py b/src/budget_sync/main.py index 15405ca..a1e7c72 100644 --- a/src/budget_sync/main.py +++ b/src/budget_sync/main.py @@ -225,19 +225,13 @@ def json_milestones(budget_graph: BudgetGraph, add_comments: bool, comments = bug_comments_map[str(child.bug.id)]['comments'] lines = comments[0]['text'].splitlines() for i, line in enumerate(lines): - # look for a line with only 4 or more `-` and blank lines - # before and after, like so: - # ``` - # - # ----- - # - # ``` - if len(line) >= 4 and line == "-" * len(line) \ - and i >= 1 and lines[i - 1] == "" and ( - i > len(lines) or lines[i + 1] == ""): - lines[i:] = [] - break - if line == "": + # look for a line with only 2 or more `-` as the + # standard way in markdown of having a "break" () + # this truncates the comment so that the RFP database + # has only the "summary description" but the rest may + # be used for "TODO" lists + l = line.strip() + if len(l) >= 2 and l == "-" * len(l) \ lines[i:] = [] break comment += "\n".join(lines) -- 2.30.2