File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,15 @@ export const RenderMarkdown: React.FC<RenderMarkdownProps> = ({ content }) => {
65
65
} ;
66
66
67
67
export const RenderMarkdownTooltip : React . FC < RenderMarkdownProps > = ( { content } ) => {
68
+ const processDescription = ( desc : string | undefined ) : string | undefined => {
69
+ if ( ! desc ) return desc ;
70
+ try {
71
+ // -> json.parse will handle esacpe characters
72
+ return JSON . parse ( `"${ desc } "` ) ;
73
+ } catch {
74
+ return desc ;
75
+ }
76
+ } ;
68
77
return (
69
78
< ReactMarkdown
70
79
remarkPlugins = { [ remarkGfm ] }
@@ -96,7 +105,7 @@ export const RenderMarkdownTooltip: React.FC<RenderMarkdownProps> = ({ content }
96
105
td : ( { ...props } ) => < StyledMarkdownTd > { props . children } </ StyledMarkdownTd >
97
106
} }
98
107
>
99
- { content }
108
+ { processDescription ( content ) as string }
100
109
</ ReactMarkdown >
101
110
) ;
102
111
} ;
You can’t perform that action at this time.
0 commit comments