@@ -126,6 +126,16 @@ def unique_strings(input_list: List[str]) -> List[str]:
126126 return unique_list
127127
128128
129+ def _expand_minute_suffix (text : str ) -> str :
130+ """Replace minute abbreviations like '30m' with '30 minutes'.
131+
132+ Only replaces when 'm' appears at a word boundary after digits
133+ (e.g. "30m" -> "30 minutes"), leaving partial-unit strings like
134+ "30ms" or "30min" unchanged.
135+ """
136+ return re .sub (r'(\d+)m\b' , r'\1 minutes' , text )
137+
138+
129139def convert_to_markdown_v2 (output_data : dict ,
130140 gfm_supported : bool = True ,
131141 incremental_review = None ,
@@ -215,11 +225,17 @@ def convert_to_markdown_v2(output_data: dict,
215225 elif 'contribution time cost estimate' in key_nice .lower ():
216226 if gfm_supported :
217227 markdown_text += f"<tr><td>{ emoji } <strong>Contribution time estimate</strong> (best, average, worst case): "
218- markdown_text += f"{ value ['best_case' ].replace ('m' , ' minutes' )} | { value ['average_case' ].replace ('m' , ' minutes' )} | { value ['worst_case' ].replace ('m' , ' minutes' )} "
228+ best = _expand_minute_suffix (value ['best_case' ])
229+ avg = _expand_minute_suffix (value ['average_case' ])
230+ worst = _expand_minute_suffix (value ['worst_case' ])
231+ markdown_text += f"{ best } | { avg } | { worst } "
219232 markdown_text += f"</td></tr>\n "
220233 else :
221234 markdown_text += f"### { emoji } Contribution time estimate (best, average, worst case): "
222- markdown_text += f"{ value ['best_case' ].replace ('m' , ' minutes' )} | { value ['average_case' ].replace ('m' , ' minutes' )} | { value ['worst_case' ].replace ('m' , ' minutes' )} \n \n "
235+ best = _expand_minute_suffix (value ['best_case' ])
236+ avg = _expand_minute_suffix (value ['average_case' ])
237+ worst = _expand_minute_suffix (value ['worst_case' ])
238+ markdown_text += f"{ best } | { avg } | { worst } \n \n "
223239 elif 'security concerns' in key_nice .lower ():
224240 if gfm_supported :
225241 markdown_text += f"<tr><td>"
0 commit comments