Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f33d2fd730
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let end = context[context.length-1] == token; | ||
| if (end) context.pop(); | ||
| else context.push(token); |
There was a problem hiding this comment.
Preserve existing emphasis contexts when consuming triple delimiters
For valid nested emphasis such as *italic **bold*** normal (and the underscore equivalent), the stack contains '*' and '**' when the closing triple run arrives. Neither entry equals '***', so this branch opens another pair instead of closing the existing tags, incorrectly keeping normal bold and italic until the end of the input. The parent renders this correctly. Triple runs need to interact with existing single/double contexts rather than act as indivisible markers; the reverse case, ***bold* italic** normal, also regresses because its separate closing markers cannot close the combined context.
Useful? React with 👍 / 👎.
|
Thanks for catching this — you were right, both cases regressed: Fixed in e1c57f1:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1c57f119b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| context.push(token); | ||
| return '<em><strong>'; |
There was a problem hiding this comment.
Split triple runs that join bold and italic spans
For adjacent formatting such as **bold***italic* normal, the stack contains only ** when the triple run arrives. The new pair-closing checks require two stacked markers, so this fallback opens another <em><strong> pair instead of closing bold and starting italics. The parent returns <strong>bold</strong><em>italic</em> normal, while this version leaves the original <strong> open through normal. Handle the close-then-open split against a lone existing delimiter before opening a combined pair.
Useful? React with 👍 / 👎.
| let top = context[context.length-1]; | ||
| if ((top === '***' || top === '___') && token[0] === top[0]) { | ||
| let next = md[tokenizer.lastIndex]; | ||
| if (next === undefined || /\s/.test(next)) { |
There was a problem hiding this comment.
Recognize partial triple closers before punctuation
The new whitespace-only guard rejects a valid partial closer followed by punctuation, such as the * in ***bold*, italic** normal. Because the next character is a comma, the closer falls through and opens another <em> instead. The parent closes both spans before normal, but this version keeps normal bold and italic until flush(). Recognize valid closing boundaries rather than treating every non-whitespace successor as evidence of an opening delimiter.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 599d887b7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /** Parse Markdown into an HTML String. */ | ||
| export default function parse(md, prevLinks) { | ||
| let tokenizer = /((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm, | ||
| let tokenizer = /((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|___|\*\*\*|__|\*\*|[_*]|~~)/gm, |
There was a problem hiding this comment.
Preserve double-delimiter boundaries in longer runs
For previously supported input such as **first****second** plain, the new alternative consumes the four-character boundary as *** + * rather than ** + **. The output changes from <strong>first</strong><strong>second</strong> plain to <strong>first</strong><em></em>second<strong> plain</strong>: second loses bold and the unformatted suffix becomes bold. The underscore equivalent regresses too. Account for longer delimiter runs before treating a three-character prefix as a combined emphasis token.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3906f1d72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let top = context[context.length-1]; | ||
| if ((top === '***' || top === '___') && token[0] === top[0]) { | ||
| let before = md.charAt(last-token.length-1), next = md.charAt(last); | ||
| if (!next || /\s/.test(next) || (/\S/.test(before) && /[!-/:-@[-`{-~]/.test(next))) { |
There was a problem hiding this comment.
Allow partial asterisk closers within words
For valid intraword asterisk emphasis such as ***bold*ness** normal, the single * must close italics even though the next character is n. The updated boundary guard rejects this alphanumeric-successor case and opens another <em> instead, leaving normal bold and italic until flush(). The parent correctly renders <strong><em>bold</em>ness</strong> normal. Recognize right-flanking asterisk closers within words rather than requiring whitespace or punctuation after them.
Useful? React with 👍 / 👎.
Fixes #113.
***text***currently renders as<strong><em>text<strong><em></em></strong></em></strong>: the tokenizer splits the run into**+*, and the closing run cannot unwind the stack in that order, so the closers are emitted as openers.This matches
***/___as a single token (before**/__) and handles it intag()as one combined<em><strong>pair, so***text***now renders as<em><strong>text</strong></em>(and likewise for___). Plain**/__/*/_parsing is untouched.Tests: 2 new tests in
test/index.js. Verified by control experiment: both fail on unpatched code; full suite passes after the fix (35 passing, was 33), andeslint src testis clean.