fix: removed theme dependency in syntaxhighlighterprovider, added mermaid delay
This commit is contained in:
parent
6536ec227a
commit
8a8deda002
@ -49,7 +49,7 @@ export const SyntaxHighlighterProvider: React.FC<PropsWithChildren> = ({ childre
|
||||
}
|
||||
|
||||
initHighlighter()
|
||||
}, [highlighterTheme, theme])
|
||||
}, [highlighterTheme])
|
||||
|
||||
const codeToHtml = async (code: string, language: string) => {
|
||||
if (!highlighter) return ''
|
||||
|
||||
@ -23,13 +23,15 @@ export const useMermaid = () => {
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (window.mermaid) {
|
||||
window.mermaid.initialize({
|
||||
startOnLoad: true,
|
||||
theme: theme === ThemeMode.dark ? 'dark' : 'default'
|
||||
})
|
||||
window.mermaid.contentLoaded()
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (window.mermaid) {
|
||||
window.mermaid.initialize({
|
||||
startOnLoad: true,
|
||||
theme: theme === ThemeMode.dark ? 'dark' : 'default'
|
||||
})
|
||||
window.mermaid.contentLoaded()
|
||||
}
|
||||
}, 2000)
|
||||
}, [theme])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user