@@ -76,6 +76,8 @@ def generate_tree_from_commits(
76
76
) -> Iterable [Dict ]:
77
77
pat = re .compile (changelog_pattern )
78
78
map_pat = re .compile (commit_parser , re .MULTILINE )
79
+ body_map_pat = re .compile (commit_parser , re .MULTILINE | re .DOTALL )
80
+
79
81
# Check if the latest commit is not tagged
80
82
latest_commit = commits [0 ]
81
83
current_tag : Optional [GitTag ] = get_commit_tag (latest_commit , tags )
@@ -110,8 +112,9 @@ def generate_tree_from_commits(
110
112
if not matches :
111
113
continue
112
114
115
+ # Process subject from commit message
113
116
message = map_pat .match (commit .message )
114
- message_body = map_pat . search ( commit . body )
117
+
115
118
if message :
116
119
parsed_message : Dict = message .groupdict ()
117
120
# change_type becomes optional by providing None
@@ -122,8 +125,15 @@ def generate_tree_from_commits(
122
125
if changelog_message_builder_hook :
123
126
parsed_message = changelog_message_builder_hook (parsed_message , commit )
124
127
changes [change_type ].append (parsed_message )
125
- if message_body :
128
+
129
+ # Process body from commit message
130
+ body_parts = commit .body .split ("\n \n " )
131
+ for body_part in body_parts :
132
+ message_body = body_map_pat .match (body_part )
133
+ if not message_body :
134
+ continue
126
135
parsed_message_body : Dict = message_body .groupdict ()
136
+
127
137
change_type = parsed_message_body .pop ("change_type" , None )
128
138
changes [change_type ].append (parsed_message_body )
129
139
0 commit comments