diff --git a/src/components/NewsletterIssueView.tsx b/src/components/NewsletterIssueView.tsx index a1556bf..7c6e071 100644 --- a/src/components/NewsletterIssueView.tsx +++ b/src/components/NewsletterIssueView.tsx @@ -29,8 +29,11 @@ function renderMarkdown(md: string) { const renderInline = (text: string): React.ReactNode[] => { const nodes: React.ReactNode[] = []; - // Tokenise **bold**, *italic*, and [label](url) / bare http(s) links. - const regex = /(\*\*([^*]+)\*\*)|(\*([^*]+)\*)|(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\))|(https?:\/\/[^\s]+)/g; + // Tokenise **bold**, *italic*, _italic_ (underscore form — issueToMarkdown + // wraps the vibe in underscores, which used to render as LITERAL underscores + // in this reader), [label](url) and bare http(s) links. + const regex = + /(\*\*([^*]+)\*\*)|(\*([^*]+)\*)|(_([^_]+)_)|(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\))|(https?:\/\/[^\s]+)/g; let last = 0; let m: RegExpExecArray | null; let i = 0; @@ -41,15 +44,17 @@ function renderMarkdown(md: string) { } else if (m[3]) { nodes.push({m[4]}); } else if (m[5]) { + nodes.push({m[6]}); + } else if (m[7]) { nodes.push( - - {m[6]} + + {m[8]} , ); - } else if (m[8]) { + } else if (m[10]) { nodes.push( - - {m[8]} + + {m[10]} , ); }