[Feature] Support loading for mermaid. (#6004)

Co-authored-by: 靖谦 <jingqian@kaiwu.cloud>
This commit is contained in:
Jinq Qian
2024-07-05 21:01:50 +08:00
committed by GitHub
parent 3f0da88ff7
commit 9f16739518
2 changed files with 27 additions and 15 deletions

View File

@@ -103,7 +103,7 @@ const useLazyLoad = (ref: RefObject<Element>): boolean => {
// visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message
// or use the non-minified dev environment for full errors and additional helpful warnings.
const CodeBlock: CodeComponent = memo(({ inline, className, children, ...props }) => {
const [isSVG, setIsSVG] = useState(false)
const [isSVG, setIsSVG] = useState(true)
const match = /language-(\w+)/.exec(className || '')
const language = match?.[1]
const languageShowName = getCorrectCapitalizationLanguageName(language || '')