"Proposal" was hard-coded as the first section and so it was deleting the "Abstract" section along with the "TODO" section.
@@ -98,7 +98,7 @@ def _fill_template(template_path: str, title: str, pr_num: int) -> str:
r"\g<1>%d" % pr_num,
content,
)
- content = re.sub(r"## TODO(?:.|\n)*(## Problem)", r"\1", content)
+ content = re.sub(r"\n## TODO(?:|\n)*?(\n## )", r"\1", content)
return content
@@ -50,6 +50,7 @@ class TestNewProposal(unittest.TestCase):
"pull/123)" in content,
+ self.assertTrue("\n## Abstract\n\n" in content, content)
def test_run_success(self):
new_proposal._run(["true"])