File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " streamdown " : patch
3+ ---
4+
5+ temporary fix for error color in rehype katex
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ export const Streamdown = memo(
8282 parseMarkdownIntoBlocks ( typeof children === 'string' ? children : '' ) ,
8383 [ children ]
8484 ) ;
85+ const rehypeKatexPlugin = useMemo (
86+ ( ) => ( ) => rehypeKatex ( { errorColor : 'var(--color-muted-foreground)' } ) ,
87+ [ ]
88+ ) ;
8589
8690 return (
8791 < ShikiThemeContext . Provider value = { shikiTheme } >
@@ -98,7 +102,7 @@ export const Streamdown = memo(
98102 defaultOrigin = { defaultOrigin }
99103 // biome-ignore lint/suspicious/noArrayIndexKey: "required"
100104 key = { `${ generatedId } -block_${ index } ` }
101- rehypePlugins = { [ rehypeKatex , ...( rehypePlugins ?? [ ] ) ] }
105+ rehypePlugins = { [ rehypeKatexPlugin , ...( rehypePlugins ?? [ ] ) ] }
102106 remarkPlugins = { [ remarkGfm , remarkMath , ...( remarkPlugins ?? [ ] ) ] }
103107 shouldParseIncompleteMarkdown = { shouldParseIncompleteMarkdown }
104108 />
You can’t perform that action at this time.
0 commit comments