Skip to content

feat: add copy buttons to problem examples - #6306

Merged
yanglbme merged 1 commit into
docsfrom
feat/example-copy
Nov 11, 2026
Merged

yanglbme merged 1 commit into
docsfrom
feat/example-copy

Conversation

@yanglbme

Copy link
Copy Markdown
Member

Summary

  • Add a copy button to each problem example, including older <pre> blocks and newer .example-block blocks.
  • The button stays in the top-right corner and appears only on hover, matching the solution code blocks. It does not shift the first line of the example.

Test plan

  • Open a problem that uses raw <pre> examples, such as problem 1, and one that uses .example-block, such as problem 20.
  • Confirm the copy button is hidden until the example is hovered, and that the first input line stays in place.
  • Copy an example and confirm the clipboard contains the original example text.
  • Check the English site uses Copy / Copied.

Made with Cursor

Problem examples are plain blocks, so the code-fence copy control does not cover them.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 06:23
@idoocs idoocs added core team Issues or pull requests from core team css js Issues or Pull requests relate to .js code yml Issues or Pull requests relate to .yml files labels Nov 11, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@yanglbme
yanglbme merged commit b35e342 into docs Nov 11, 2026
3 checks passed
@yanglbme
yanglbme deleted the feat/example-copy branch November 11, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core team Issues or pull requests from core team css js Issues or Pull requests relate to .js code yml Issues or Pull requests relate to .yml files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants