* Render a line with inline code highlighting
(line: string)
| 104 | * Render a line with inline code highlighting |
| 105 | */ |
| 106 | function renderLineWithInlineCode(line: string): React.ReactNode { |
| 107 | const parts = line.split(/(`[^`]+`)/g); |
| 108 | |
| 109 | return parts.map((part, index) => { |
| 110 | if (part.startsWith("`") && part.endsWith("`")) { |
| 111 | // This is inline code |
| 112 | return ( |
| 113 | <span key={index} className="bg-gray-200 dark:bg-gray-800 px-1 rounded"> |
| 114 | {part} |
| 115 | </span> |
| 116 | ); |
| 117 | } |
| 118 | // Regular text |
| 119 | return part; |
| 120 | }); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Markdown block for AGENTS.md examples. |