選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

pre-code.tsx 488B

123456789101112131415161718192021
  1. /**
  2. * @fileoverview PreCode component for rendering <pre> tags in Markdown.
  3. * Extracted from the main markdown renderer for modularity.
  4. * This is a simple wrapper around the HTML <pre> element.
  5. */
  6. import React, { useRef } from 'react'
  7. function PreCode(props: { children: any }) {
  8. const ref = useRef<HTMLPreElement>(null)
  9. return (
  10. <pre ref={ref}>
  11. <span
  12. className="copy-code-button"
  13. ></span>
  14. {props.children}
  15. </pre>
  16. )
  17. }
  18. export default PreCode