@@ -30,11 +30,8 @@ export default {
3030 /** @type string[] */
3131 const usersFromSummary = [ ] ;
3232
33- // Parse summary to extract scope and description
34- const summary = changeset . summary ;
35-
3633 // Remove PR, commit, author/user lines from summary
37- const replacedChangelog = summary
34+ const replacedChangelog = changeset . summary
3835 . replace ( / ^ \s * (?: p r | p u l l | p u l l \s + r e q u e s t ) : \s * # ? ( \d + ) / im, ( _ , pr ) => {
3936 const num = Number ( pr ) ;
4037 if ( ! Number . isNaN ( num ) ) {
@@ -52,24 +49,6 @@ export default {
5249 } )
5350 . trim ( ) ;
5451
55- // Detect scope from **scope**: format
56- const scopeMatch = replacedChangelog . match ( / ^ \* \* ( [ ^ : ] + ) \* \* : ? \s * ( .* ) $ / ) ;
57- const scope = scopeMatch ? scopeMatch [ 1 ] : null ;
58- const description = scopeMatch ? scopeMatch [ 2 ] : replacedChangelog ;
59-
60- // Detect breaking changes (explicit BREAKING or major version) - for future use
61- const explicitBreaking =
62- / ^ B R E A K I N G [: \s] / i. test ( replacedChangelog ) || / \b B R E A K I N G C H A N G E \b / i. test ( replacedChangelog ) ;
63- void explicitBreaking ;
64-
65- // Build formatted entry
66- const entryParts = [ ] ;
67- if ( scope ) {
68- entryParts . push ( `**${ scope } **: ${ description } ` ) ;
69- } else {
70- entryParts . push ( description ) ;
71- }
72-
7352 const links = await ( async ( ) => {
7453 if ( prFromSummary !== undefined ) {
7554 let { links } = await getInfoFromPullRequest ( {
@@ -102,13 +81,27 @@ export default {
10281 } ;
10382 } ) ( ) ;
10483
105- // Add PR link at end
106- if ( links . pull ) {
107- entryParts . push ( `(${ links . pull } )` ) ;
108- } else if ( prFromSummary !== undefined ) {
109- entryParts . push ( `([#${ prFromSummary } ](https://github.com/${ repo } /pull/${ prFromSummary } ))` ) ;
110- }
84+ const users = usersFromSummary . length
85+ ? usersFromSummary
86+ . map ( ( userFromSummary ) => `[@${ userFromSummary } ](https://github.com/${ userFromSummary } )` )
87+ . join ( ', ' )
88+ : links . user ;
89+
90+ const metadata = [
91+ links . pull === null ? '' : ` (${ links . pull } )` ,
92+ links . commit === null ? '' : ` (${ links . commit } )` ,
93+ users === null ? '' : ` by ${ users } ` ,
94+ ] . join ( '' ) ;
11195
112- return `\n- ${ entryParts . join ( ' ' ) } ` ;
96+ // Split summary into first line and the rest
97+ const [ firstLine , ...rest ] = replacedChangelog . split ( '\n' ) ;
98+ const restSummary = rest . join ( '\n' ) . trim ( ) ;
99+
100+ // No code block conversion: preserve original triple backtick code blocks and indentation
101+ let releaseLine = `\n- ${ firstLine } ${ metadata } ` ;
102+ if ( restSummary ) {
103+ releaseLine += '\n\n' + restSummary ;
104+ }
105+ return releaseLine ;
113106 } ,
114107} ;
0 commit comments