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()
|
initHighlighter()
|
||||||
}, [highlighterTheme, theme])
|
}, [highlighterTheme])
|
||||||
|
|
||||||
const codeToHtml = async (code: string, language: string) => {
|
const codeToHtml = async (code: string, language: string) => {
|
||||||
if (!highlighter) return ''
|
if (!highlighter) return ''
|
||||||
|
|||||||
@ -23,6 +23,7 @@ export const useMermaid = () => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
if (window.mermaid) {
|
if (window.mermaid) {
|
||||||
window.mermaid.initialize({
|
window.mermaid.initialize({
|
||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
@ -30,6 +31,7 @@ export const useMermaid = () => {
|
|||||||
})
|
})
|
||||||
window.mermaid.contentLoaded()
|
window.mermaid.contentLoaded()
|
||||||
}
|
}
|
||||||
|
}, 2000)
|
||||||
}, [theme])
|
}, [theme])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user