Skip to content

Copy to clipboard includes code line numbers #393

@jjhidalgar

Description

@jjhidalgar

Describe the bug

By default, or when using :no-line-numbers="false", the plugin will show line numbers on the left side, whenever you are using a code block

To Reproduce

<q-markdown show-copy :no-line-numbers="false">
```javascript
{{JSON.stringify(JSON.parse('{"name":"John", "age":30, "car":null}'), null, 2)}}
```
</q-markdown>

Expected behavior

Copy button should copy the content I set using the slot, or using the "src" component. Line numbers should be part of the style and shout not be copied.

Suggested Solution

Option A) Do not copy numbers

Option B) Create an event @on-copy that will return the actual content to be copied. This would solve many other similar issues.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Chrome
  • Version: Latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions