File tree Expand file tree Collapse file tree
apps/web/src/app/changelog/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,14 +29,12 @@ function buildMarkdown({
2929 for ( const type of orderedTypes ) {
3030 if ( isSectionCollapsible ( { type } ) ) {
3131 lines . push (
32- "<details>" ,
33- `<summary>${ getSectionTitle ( { type } ) } </summary>` ,
32+ buildCollapsibleMarkdownSection ( {
33+ title : getSectionTitle ( { type } ) ,
34+ changes : grouped [ type ] ,
35+ } ) ,
3436 "" ,
3537 ) ;
36- for ( const change of grouped [ type ] ) {
37- lines . push ( `- ${ change . text } ` ) ;
38- }
39- lines . push ( "" , "</details>" , "" ) ;
4038 continue ;
4139 }
4240
@@ -50,6 +48,18 @@ function buildMarkdown({
5048 return lines . join ( "\n" ) . trimEnd ( ) ;
5149}
5250
51+ function buildCollapsibleMarkdownSection ( {
52+ title,
53+ changes,
54+ } : {
55+ title : string ;
56+ changes : Change [ ] ;
57+ } ) : string {
58+ const bulletLines = changes . map ( ( change ) => `- ${ change . text } ` ) . join ( "\n" ) ;
59+
60+ return `<details>\n<summary>${ title } </summary>\n\n${ bulletLines } \n\n</details>` ;
61+ }
62+
5363export function CopyMarkdownButton ( {
5464 description,
5565 changes,
You can’t perform that action at this time.
0 commit comments