Skip to content

[EuiCodeBlock] enabling lineNumbers causes copied text to contain actual line numbers #6818

@tkajtoch

Description

@tkajtoch

Describe the bug

When lineNumbers = true and isCopyable = true the copied text contains code block content as well as line numbers.

This bug references elastic/kibana#158644.

Environment and versions

  • EUI version: v81.0.0
  • Browser: all (tested on Chrome, Safari and Firefox)
  • Operating System: all (tested on MacOS)

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://eui.elastic.co/#/editors-syntax/code#code-block
  2. Click on Playground
  3. Enable lineNumbers and isCopyable
  4. Click the copy icon
  5. See that the copied text contains line numbers

Expected behavior

The copied text should not contain line numbers.

Minimum reproducible sandbox

https://codesandbox.io/s/young-fast-rh60ds?file=/demo.js

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions