fix: replace /s regex flag with [\s\S] for ES2017 compat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-02-15 09:49:49 -07:00
parent 560dceec0f
commit e6fb53bf15
1 changed files with 3 additions and 3 deletions

View File

@ -181,7 +181,7 @@ function renderInline(text: string): React.ReactNode {
while (remaining.length > 0) { while (remaining.length > 0) {
// Bold **text** // Bold **text**
const boldMatch = remaining.match(/^(.*?)\*\*(.+?)\*\*(.*)$/s) const boldMatch = remaining.match(/^([\s\S]*?)\*\*([\s\S]+?)\*\*([\s\S]*)$/)
if (boldMatch) { if (boldMatch) {
if (boldMatch[1]) parts.push(<span key={key++}>{boldMatch[1]}</span>) if (boldMatch[1]) parts.push(<span key={key++}>{boldMatch[1]}</span>)
parts.push(<strong key={key++} className="text-white font-medium">{boldMatch[2]}</strong>) parts.push(<strong key={key++} className="text-white font-medium">{boldMatch[2]}</strong>)
@ -190,7 +190,7 @@ function renderInline(text: string): React.ReactNode {
} }
// Italic *text* // Italic *text*
const italicMatch = remaining.match(/^(.*?)\*(.+?)\*(.*)$/s) const italicMatch = remaining.match(/^([\s\S]*?)\*([\s\S]+?)\*([\s\S]*)$/)
if (italicMatch) { if (italicMatch) {
if (italicMatch[1]) parts.push(<span key={key++}>{italicMatch[1]}</span>) if (italicMatch[1]) parts.push(<span key={key++}>{italicMatch[1]}</span>)
parts.push(<em key={key++} className="text-slate-300 italic">{italicMatch[2]}</em>) parts.push(<em key={key++} className="text-slate-300 italic">{italicMatch[2]}</em>)
@ -199,7 +199,7 @@ function renderInline(text: string): React.ReactNode {
} }
// Inline code `text` // Inline code `text`
const codeMatch = remaining.match(/^(.*?)`(.+?)`(.*)$/s) const codeMatch = remaining.match(/^([\s\S]*?)`([\s\S]+?)`([\s\S]*)$/)
if (codeMatch) { if (codeMatch) {
if (codeMatch[1]) parts.push(<span key={key++}>{codeMatch[1]}</span>) if (codeMatch[1]) parts.push(<span key={key++}>{codeMatch[1]}</span>)
parts.push( parts.push(