File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,17 @@ export const RenderMarkdown: React.FC<RenderMarkdownProps> = ({ content }) => {
2626 remarkPlugins = { [ remarkGfm ] }
2727 components = { {
2828 p : ( { ...props } ) => < StyledMarkdownP > { props . children } </ StyledMarkdownP > ,
29- a : ( { ...props } ) => < StyledMarkdown > { props . children } </ StyledMarkdown > ,
29+ a : ( { ...props } ) => (
30+ < StyledMarkdown
31+ onClick = { ( e ) => {
32+ e . preventDefault ( ) ;
33+ window . open ( props . href , '_blank' ) ;
34+ } }
35+ href = { props . href }
36+ >
37+ { props . children }
38+ </ StyledMarkdown >
39+ ) ,
3040 h1 : ( { ...props } ) => < StyledMarkdownH1 > { props . children } </ StyledMarkdownH1 > ,
3141 h2 : ( { ...props } ) => < StyledMarkdownH2 > { props . children } </ StyledMarkdownH2 > ,
3242 h3 : ( { ...props } ) => < StyledMarkdownH3 > { props . children } </ StyledMarkdownH3 > ,
@@ -53,7 +63,17 @@ export const RenderMarkdownTooltip: React.FC<RenderMarkdownProps> = ({ content }
5363 remarkPlugins = { [ remarkGfm ] }
5464 components = { {
5565 p : ( { ...props } ) => < StyledMarkdownTooltipP > { props . children } </ StyledMarkdownTooltipP > ,
56- a : ( { ...props } ) => < StyledMarkdown > { props . children } </ StyledMarkdown > ,
66+ a : ( { ...props } ) => (
67+ < StyledMarkdown
68+ onClick = { ( e ) => {
69+ e . preventDefault ( ) ;
70+ window . open ( props . href , '_blank' ) ;
71+ } }
72+ href = { props . href }
73+ >
74+ { props . children }
75+ </ StyledMarkdown >
76+ ) ,
5777 h1 : ( { ...props } ) => < StyledMarkdownH1 > { props . children } </ StyledMarkdownH1 > ,
5878 h2 : ( { ...props } ) => < StyledMarkdownH2 > { props . children } </ StyledMarkdownH2 > ,
5979 h3 : ( { ...props } ) => < StyledMarkdownH3 > { props . children } </ StyledMarkdownH3 > ,
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ export const StyledMarkdown = styled('a')(({ theme }) => ({
66 textDecoration : 'none' ,
77 '&:hover' : {
88 textDecoration : 'underline'
9- }
9+ } ,
10+ cursor : 'pointer'
1011} ) ) ;
1112
1213export const StyledMarkdownP = styled ( 'p' ) ( ( { theme } ) => ( {
You can’t perform that action at this time.
0 commit comments