diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx index 465a4f747bcb..d918007e5750 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.tsx @@ -55,6 +55,9 @@ function AnchorRenderer({tnode, style, key}: AnchorRendererProps) { ); } + const hasStrikethroughStyle = 'textDecorationLine' in parentStyle && parentStyle.textDecorationLine === 'line-through'; + const textDecorationLineStyle = hasStrikethroughStyle ? styles.underlineLineThrough : {}; + return ( Link.openLink(attrHref, environmentURL, isAttachment) : undefined} > - + { + if (props.childTnode.tagName === 'br') { + return {'\n'}; + } + if (props.childTnode.type === 'text') { + return ( + + {props.childTnode.data} + + ); + } + return props.childElement; + }} + /> ); } diff --git a/src/styles/utils/textDecorationLine.ts b/src/styles/utils/textDecorationLine.ts index e5f079150e78..5e830cbf08c1 100644 --- a/src/styles/utils/textDecorationLine.ts +++ b/src/styles/utils/textDecorationLine.ts @@ -5,4 +5,8 @@ export default { textDecorationLine: 'line-through', textDecorationStyle: 'solid', }, + underlineLineThrough: { + textDecorationLine: 'underline line-through', + textDecorationStyle: 'solid', + }, } satisfies Record;