Skip to content

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Apr 2, 2025

Changes

Removes trailing spaces after a line in a code block. If there is a code callout it will add an empty span with the width of the removed spaces.

The will preserve alignment of code callouts.

Additionally, use css ::after element for the code callout index number to make sure it can't be copied.

How to test

  1. Go to https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/946/syntax/code#align-callouts
  2. And copy the code snippet:
    • with the copy button
    • and while selecting the text and copy it
  3. The pasted code should not have any trailing white spaces

@reakaleek reakaleek requested a review from a team as a code owner April 2, 2025 13:35
@reakaleek reakaleek added the fix label Apr 2, 2025
@reakaleek reakaleek self-assigned this Apr 2, 2025
@leemthompo
Copy link
Contributor

🙌 thanks!

@reakaleek reakaleek merged commit f5833d4 into main Apr 2, 2025
14 checks passed
@reakaleek reakaleek deleted the feature/fix-copy-code-block branch April 2, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants