Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

script-block.tsx 623B

123456789101112131415
  1. /**
  2. * @fileoverview ScriptBlock component for handling <script> tags in Markdown.
  3. * Extracted from the main markdown renderer for modularity.
  4. * Note: Current implementation returns the script tag as a string, which might not execute as expected in React.
  5. * This behavior is preserved from the original implementation and may need review for security and functionality.
  6. */
  7. import { memo } from 'react'
  8. const ScriptBlock = memo(({ node }: any) => {
  9. const scriptContent = node.children[0]?.value || ''
  10. return `<script>${scriptContent}</script>`
  11. })
  12. ScriptBlock.displayName = 'ScriptBlock'
  13. export default ScriptBlock