mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Fix handling of tables
This commit is contained in:
@ -166,6 +166,27 @@ def release(args):
|
|||||||
first_section.pop(0)
|
first_section.pop(0)
|
||||||
|
|
||||||
changes = ''.join(first_section)
|
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.checkout('-B', 'release')
|
||||||
fmt_repo.add(changelog)
|
fmt_repo.add(changelog)
|
||||||
|
Reference in New Issue
Block a user