Skip to content

[DOC, TST] Match longer IPython continuation prompts - #227

Open
ac1982 wants to merge 1 commit into
executablebooks:masterfrom
ac1982:docs/ipython-continuation-prompts
Open

ac1982 wants to merge 1 commit into
executablebooks:masterfrom
ac1982:docs/ipython-continuation-prompts

Conversation

@ac1982

@ac1982 ac1982 commented Oct 15, 2026

Copy link
Copy Markdown

Fixes #217.

The documented prompt regex accepts exactly three continuation dots. IPython's Sphinx directive uses more dots as the cell counter grows, so following the example drops continuation lines from copied code after cell 9.

Use \.{3,} in both the documented configuration and the documentation site's conf.py. Update the pattern table and live example to show multi-digit counters. The generic copying implementation and extension defaults are unchanged.

Added tests read the actual docs configuration, check it agrees with the documented snippet, and copy multiline inputs numbered 1, 10, 100 and 1000. The last three fail with the original configuration.

Validation:

  • AVA with the CI's Node 12: 22 tests pass.
  • Full Sphinx HTML build on Python 3.12 and all pre-commit hooks pass.
  • Clicking the live example's copy button in Chromium preserves both continuation lines; loading the original generated copybutton.js against the same page loses the multi-digit continuation.
  • System Node 24 cannot run the existing esm-based test harness, so validation used Node 12. No dependency changes are included.

Prepared and validated with Codex assistance.

This branch has not been deployed

No deployments
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.

Default regular expression for the copy button fails for double digit ipython cells

1 participant