aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Zverovich <viz@meta.com>2023-12-30 09:57:31 -0800
committerVictor Zverovich <viz@meta.com>2023-12-30 09:57:31 -0800
commit28576b0600c0ce9183decfcd88e61c4ab6ca33db (patch)
tree761532021666c1e567d49cb172e344bbb471cfb9
parent5ddd0cad15999439bbf96aa2e5241e9dced848ed (diff)
downloadfmtlib-28576b0600c0ce9183decfcd88e61c4ab6ca33db.tar.gz
Workaround github markdown mess
-rwxr-xr-xsupport/manage.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/support/manage.py b/support/manage.py
index aa1a6bc1..0e116010 100755
--- a/support/manage.py
+++ b/support/manage.py
@@ -232,12 +232,22 @@ def release(args):
# Update the date in the changelog.
changelog = 'ChangeLog.md'
changelog_path = os.path.join(fmt_repo.dir, changelog)
- title_len = 0
+ first_section = True
+ code_block = False
+ changes = ''
for line in fileinput.input(changelog_path, inplace=True):
m = re.match(r'# (.*) - TBD', line)
if m:
version = m.group(1)
line = version + ' - ' + datetime.date.today().isoformat() + '\n'
+ elif line.startswith('#'):
+ first_section = False
+ elif first_section:
+ changes += line
+ if re.match(r'^\s*```', line):
+ code_block = not code_block
+ elif not code_block and line != '\n':
+ changes = changes.rstrip() + ' '
sys.stdout.write(line)
cmakelists = 'CMakeLists.txt'