@@ -18,7 +18,6 @@ import type { ASTNode, RendererCallbacks, RenderCapabilities } from './types';
1818import { indexTaskItems , markInlineImages } from './utils' ;
1919import { loadKaTeX } from './katex' ;
2020import type { KaTeXInstance } from './katex' ;
21- import { normalizeColor } from '../styleUtils' ;
2221
2322export const EnrichedMarkdownText = ( {
2423 markdown,
@@ -103,21 +102,18 @@ export const EnrichedMarkdownText = ({
103102 [ lastChildStyle ]
104103 ) ;
105104
106- const wrapperStyle = useMemo < CSSProperties > ( ( ) => {
107- const selectionColorCss = selectionColor
108- ? normalizeColor ( String ( selectionColor ) )
109- : undefined ;
110-
111- return {
105+ const wrapperStyle = useMemo < CSSProperties > (
106+ ( ) => ( {
112107 display : 'flex' ,
113108 flexDirection : 'column' ,
114109 ...( containerStyle as CSSProperties ) ,
115110 ...( selectable ? undefined : { userSelect : 'none' } ) ,
116- ...( selectionColorCss != null
117- ? ( { [ '--enrm-selection-bg' ] : selectionColorCss } as CSSProperties )
111+ ...( selectionColor
112+ ? ( { [ '--enrm-selection-bg' ] : selectionColor } as CSSProperties )
118113 : null ) ,
119- } ;
120- } , [ containerStyle , selectable , selectionColor ] ) ;
114+ } ) ,
115+ [ containerStyle , selectable , selectionColor ]
116+ ) ;
121117
122118 const selectionStyle = selectionColor ? (
123119 < style > { `[data-enriched-markdown-text] ::selection {
0 commit comments