Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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