File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/rlc-common/src/metadata Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -409,12 +409,13 @@ function updateKeyLinksSection(
409409 existingContent : string ,
410410 newKeyLinksSection : string
411411) : string {
412- const keyLinksPattern = / K e y l i n k s : \s * \n ( (?: (?: \n | .) * ?) (? = \n # # | \n # | $ ) ) / ;
412+ // Match "Key links:" followed by content until the next section (## or #) or end of file
413+ const keyLinksPattern = / K e y l i n k s : \s * \n [ \s \S ] * ?(? = \n # # | \n # | $ ) / ;
413414
414415 if ( existingContent . match ( keyLinksPattern ) ) {
416+ // Replace the entire Key links section with the new content
415417 // Ensure there's a blank line after the Key links section
416- const newKeyLinksWithBlankLine = newKeyLinksSection + "\n" ;
417- return existingContent . replace ( keyLinksPattern , newKeyLinksWithBlankLine ) ;
418+ return existingContent . replace ( keyLinksPattern , newKeyLinksSection + "\n" ) ;
418419 }
419420
420421 return existingContent ;
You can’t perform that action at this time.
0 commit comments