Skip to content

Commit d647e16

Browse files
committed
chore: handle more block ends
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 911cf05 commit d647e16

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tools/make_changelog.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@
1212
from rich import print
1313
from rich.syntax import Syntax
1414

15+
1516
MD_ENTRY = re.compile(
1617
r"""
17-
\#\#\ Suggested\ changelog\ entry: # Match the heading exactly
18-
(?:\s*<!--.*?-->)? \s* # Optionally match one HTML comment, allowing surrounding whitespace
19-
(?P<content>.*?) # Lazily capture everything after (non-greedy)
20-
\s*\Z # Allow and trim trailing whitespace until end of string
18+
\#\#\ Suggested\ changelog\ entry: # Match the heading exactly
19+
(?:\s*<!--.*?-->)? # Optionally match one comment
20+
(?P<content>.*?) # Lazily capture content until...
21+
(?= # Lookahead for one of the following:
22+
^-{3,}\s*$ # A line with 3 or more dashes
23+
| ^<!--\s*readthedocs # A comment starting with 'readthedocs'
24+
| ^\#\# # A new heading
25+
| \Z # End of string
26+
)
2127
""",
22-
re.DOTALL | re.VERBOSE,
28+
re.DOTALL | re.VERBOSE | re.MULTILINE,
2329
)
2430
print()
2531

@@ -59,7 +65,7 @@
5965
missing.append(issue)
6066
continue
6167

62-
msg = changelog.group("content")
68+
msg = changelog.group("content").strip()
6369
if msg.startswith("- "):
6470
msg = msg[2:]
6571
if not msg.startswith("* "):

0 commit comments

Comments
 (0)