From 3f251fc9c986dbef536f2d44c7ffa1c6a43832b6 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 29 Jun 2024 09:23:02 -0700 Subject: [PATCH] Fix handling of tables --- support/manage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/support/manage.py b/support/manage.py index 51c4b11f..10cd180f 100755 --- a/support/manage.py +++ b/support/manage.py @@ -166,6 +166,27 @@ def release(args): first_section.pop(0) changes = ''.join(first_section) + code_block = False + stripped = False + for line in first_section: + if re.match(r'^\s*```', line): + code_block = not code_block + changes += line + stripped = False + continue + if code_block: + changes += line + continue + if line == '\n' or re.match(r'^\s*|', line): + changes += line + if stripped: + changes += line + stripped = False + continue + if stripped: + line = ' ' + line.lstrip() + changes += line.rstrip() + stripped = True fmt_repo.checkout('-B', 'release') fmt_repo.add(changelog)