@@ -55,6 +55,9 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) {
55
55
) ;
56
56
}
57
57
58
+ const hasStrikethroughStyle = 'textDecorationLine' in parentStyle && parentStyle . textDecorationLine === 'line-through' ;
59
+ const textDecorationLineStyle = hasStrikethroughStyle ? styles . underlineLineThrough : { } ;
60
+
58
61
return (
59
62
< AnchorForCommentsOnly
60
63
href = { attrHref }
@@ -65,12 +68,30 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) {
65
68
// eslint-disable-next-line react/jsx-props-no-multi-spaces
66
69
target = { htmlAttribs . target || '_blank' }
67
70
rel = { htmlAttribs . rel || 'noopener noreferrer' }
68
- style = { [ style , parentStyle , styles . textUnderlinePositionUnder , styles . textDecorationSkipInkNone ] }
71
+ style = { [ style , parentStyle , textDecorationLineStyle , styles . textUnderlinePositionUnder , styles . textDecorationSkipInkNone ] }
69
72
key = { key }
70
73
// Only pass the press handler for internal links. For public links or whitelisted internal links fallback to default link handling
71
74
onPress = { internalNewExpensifyPath || internalExpensifyPath ? ( ) => Link . openLink ( attrHref , environmentURL , isAttachment ) : undefined }
72
75
>
73
- < TNodeChildrenRenderer tnode = { tnode } />
76
+ < TNodeChildrenRenderer
77
+ tnode = { tnode }
78
+ renderChild = { ( props ) => {
79
+ if ( props . childTnode . tagName === 'br' ) {
80
+ return < Text key = { props . key } > { '\n' } </ Text > ;
81
+ }
82
+ if ( props . childTnode . type === 'text' ) {
83
+ return (
84
+ < Text
85
+ key = { props . key }
86
+ style = { [ props . childTnode . getNativeStyles ( ) , parentStyle , textDecorationLineStyle , styles . textUnderlinePositionUnder , styles . textDecorationSkipInkNone ] }
87
+ >
88
+ { props . childTnode . data }
89
+ </ Text >
90
+ ) ;
91
+ }
92
+ return props . childElement ;
93
+ } }
94
+ />
74
95
</ AnchorForCommentsOnly >
75
96
) ;
76
97
}
0 commit comments