Skip to content

fix: keep inline code that holds a backtick intact in answers - #77

Merged
youdie006 merged 2 commits into
mainfrom
fix/answer-inline-code-backticks
Oct 29, 2026
Merged

youdie006 merged 2 commits into
mainfrom
fix/answer-inline-code-backticks

Conversation

@youdie006

Copy link
Copy Markdown
Owner

Problem

The answer reader wrapped inline code in one backtick on each side. Measured 2026-10-29: the page showed the inline codes ``a`b`` and ``echo `date` ``, and the answer came back as `a`b` and `echo `date` `. Markdown reads those as different spans with stray backticks between them.

Change

inlineCode() in CHATGPT_RENDERED_MESSAGE_TEXT_JS follows CommonMark:

  • the backtick run around the code is longer than any run inside it;
  • a space is added inside when the code starts or ends with a backtick;
  • a space is also added when the code has a space at both ends, which markdown would otherwise strip.

Plain inline code is unchanged.

Verified

  • 3 tests in tests/answer-markdown.test.ts. The two backtick cases failed before the fix, with the live output.
  • npx tsc --noEmit; npm test: 147 files, 1829 passed, 3 skipped. One earlier full run failed the tiny-timeout case in browser-slow-vs-dead.test.ts under load; it passed three times alone and in the rerun.
  • Live, Instant, branch build: Runecho date to print the date, ora`bfor short., matching the page.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV

The answer reader wrapped inline code in one backtick on each side, so
the code a`b came back as `a`b`, which markdown reads as a one-letter
span and a stray backtick (measured 2026-10-29: the page showed the
codes ``a`b`` and ``echo `date` ``). Inline code now goes in a
backtick run longer than any inside it, padded with a space when it
starts or ends with a backtick or has a space at both ends that markdown
would strip, as CommonMark specifies.

Verified: failing tests first, then tsc --noEmit and npm test (147
files, 1829 passed, 3 skipped; one earlier full run failed
browser-slow-vs-dead's tiny-timeout case under load, which passed three
times alone and in the rerun). Live, Instant, branch build: the answer
came back as "Run ``echo `date` `` to print the date, or ``a`b`` for
short.", matching what the page showed.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T03:43:41.128404Z 3681244 PR opened
ℹ️ 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.

@github-actions

Copy link
Copy Markdown

What this touches

  • browser adapter
  • tests

3 file(s), 36 line(s) changed. Tests changed.

This is an automated first pass, not a review. CI is the gate; a person decides.

@youdie006
youdie006 merged commit f02396b into main Oct 29, 2026
7 checks passed
youdie006 added a commit that referenced this pull request Oct 29, 2026
…r image

Inline code goes in a backtick run longer than any inside it, padded
where CommonMark needs a space.

Verified: tsc --noEmit; tests/answer-markdown.test.ts passes. The full
suite runs after the last port in this batch.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
youdie006 added a commit that referenced this pull request Oct 29, 2026
The separator row of an answer's table follows the cells' data-d-align
(start, center, end) instead of writing --- for every column.

Verified on this commit, with the #74-#77 ports below it: tsc --noEmit,
build, npm test (166 files, 2144 passed, 3 skipped) and
npm run release:verify.

Claude-Session: https://claude.ai/code/session_01EMqNwnnhHXznd2P2PDsaDV
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.

1 participant