@@ -76,6 +76,8 @@ def generate_tree_from_commits(
7676) -> Iterable [Dict ]:
7777 pat = re .compile (changelog_pattern )
7878 map_pat = re .compile (commit_parser , re .MULTILINE )
79+ body_map_pat = re .compile (commit_parser , re .MULTILINE | re .DOTALL )
80+
7981 # Check if the latest commit is not tagged
8082 latest_commit = commits [0 ]
8183 current_tag : Optional [GitTag ] = get_commit_tag (latest_commit , tags )
@@ -110,8 +112,9 @@ def generate_tree_from_commits(
110112 if not matches :
111113 continue
112114
115+ # Process subject from commit message
113116 message = map_pat .match (commit .message )
114- message_body = map_pat . search ( commit . body )
117+
115118 if message :
116119 parsed_message : Dict = message .groupdict ()
117120 # change_type becomes optional by providing None
@@ -122,8 +125,15 @@ def generate_tree_from_commits(
122125 if changelog_message_builder_hook :
123126 parsed_message = changelog_message_builder_hook (parsed_message , commit )
124127 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
126135 parsed_message_body : Dict = message_body .groupdict ()
136+
127137 change_type = parsed_message_body .pop ("change_type" , None )
128138 changes [change_type ].append (parsed_message_body )
129139
0 commit comments