Skip to content

fix: parse *** and ___ as nested bold+italic - #124

Open
Ultroncn wants to merge 5 commits into
developit:mainfrom
Ultroncn:fix/triple-emphasis
Open

Ultroncn wants to merge 5 commits into
developit:mainfrom
Ultroncn:fix/triple-emphasis

Conversation

@Ultroncn

Copy link
Copy Markdown

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 in tag() 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), and eslint src test is clean.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T20:07:12.782438Z b3906f1 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/index.js Resolved
@Ultroncn

Copy link
Copy Markdown
Author

Thanks for catching this — you were right, both cases regressed: *italic **bold*** normal and ***bold* italic** normal kept normal inside the bold+italic tags, while the parent rendered them correctly.

Fixed in e1c57f1:

  • A triple run (***/___) now closes an already-open single+double pair instead of opening another pair.
  • A single/double run now closes just its half of an open triple pair when it cannot open a nested run (followed by whitespace or end of input).
  • Added two regression tests for both cases; npm test is 37/37 green, including the PR's original ***/___ tests.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/index.js Resolved
Comment thread src/index.js Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/index.js Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/index.js Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The output for nested italic and bold is incorrect.

1 participant