File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
webview-ui/src/components/history Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ type CopyButtonProps = {
1717 * @returns Text with highlight spans removed but content preserved
1818 */
1919const stripHistoryHighlightSpans = ( text : string ) : string => {
20- // Use regex to specifically target history-item-highlight spans
21- // This preserves other HTML/XML that might be intentional
22- return text . replace ( / < s p a n \s + c l a s s = " h i s t o r y - i t e m - h i g h l i g h t " > ( [ ^ < ] * ) < \/ s p a n > / g, "$1" )
20+ // Match opening tag, capture content until closing tag
21+ // The [\s\S]*? pattern matches any character (including newlines) non-greedily,
22+ // which properly handles content with < characters
23+ return text . replace ( / < s p a n \s + c l a s s = " h i s t o r y - i t e m - h i g h l i g h t " > ( [ \s \S ] * ?) < \/ s p a n > / g, "$1" )
2324}
2425
2526export const CopyButton = ( { itemTask, className } : CopyButtonProps ) => {
You can’t perform that action at this time.
0 commit comments