File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,18 @@ function classifyTitle(title) {
7777// --- Normalize title for display (keep all prefixes in brackets as-is) ---
7878function normalizeTitleForNotes ( title ) {
7979 let t = title . trim ( ) ;
80- const match = t . match ( / ^ [ \s \p{ Emoji_Presentation} \p{ Extended_Pictographic} ] * \s * ( b u g | f e a t | e n h a n c e m e n t | r e f a c t o r | d o c s | t e s t | c h o r e | t a s k | c o m p o s i t e | u x \/ u i | p r o p o s a l | i d e a | d i s c u s s i o n ) [: \s - ] + / i) ;
80+
81+ // Match leading emoji + optional :emoji: + optional text prefix like chore:, feat:, etc.
82+ const match = t . match ( / ^ ( [ \s \p{ Emoji_Presentation} \p{ Extended_Pictographic} ] + | ( : [ a - z A - Z 0 - 9 _ + - ] + : ) + ) \s * ( b u g | f e a t | e n h a n c e m e n t | r e f a c t o r | d o c s | t e s t | c h o r e | t a s k | c o m p o s i t e | u x \/ u i ) [: \s - ] + / i) ;
8183 if ( match ) {
82- const prefix = match [ 1 ] ;
83- t = t . replace ( match [ 0 ] , `[${ prefix . charAt ( 0 ) . toUpperCase ( ) + prefix . slice ( 1 ) . toLowerCase ( ) } ] ` ) ;
84+ const prefix = match [ 3 ] . toLowerCase ( ) ;
85+ const sectionName = PREFIX_MAP [ prefix ] ;
86+ if ( sectionName ) {
87+ // Replace everything matched with [Prefix] (first letter capitalized)
88+ t = t . replace ( match [ 0 ] , `[${ prefix . charAt ( 0 ) . toUpperCase ( ) + prefix . slice ( 1 ) } ] ` ) ;
89+ }
8490 }
91+
8592 return t ;
8693}
8794
You can’t perform that action at this time.
0 commit comments