Refactor/markdown component split (#20177)

This commit is contained in:
sayThQ199 2025-05-30 11:31:50 +08:00 • committed by GitHub
commit f65c2fcb1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 319 additions and 210 deletions

View file

@ -0,0 +1,21 @@
/**
* @fileoverview PreCode component for rendering <pre> tags in Markdown.
* Extracted from the main markdown renderer for modularity.
* This is a simple wrapper around the HTML <pre> element.
*/
import React, { useRef } from 'react'
function PreCode(props: { children: any }) {
const ref = useRef<HTMLPreElement>(null)
return (
<pre ref={ref}>
<span
className="copy-code-button"
></span>
{props.children}
</pre>
)
}
export default PreCode