Skip to content

DOC: copybutton does not copy complete example #9263

Closed
@mosc9575

Description

@mosc9575

What happened?

In the documentation sometimes the copy button fails to copy the complete example. One example can be seen in the HDF section

failing_copy_button

This is because the number of dots (4) are not matched by the regular expression of the copy button, this regular expression needs a small tweak.

To explain the problem in more detail, the io page uses ipython to run the example code and there are many cells. The regular expression

copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "

is working working for the first 9 cells. If there is a double digit cell with a multi line example, the copy button does not work.
The regular expression looks for 3 dots ans a double dot. But for larger numbers there are the length of the number of the cell plus two dots.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions