quasarframework / quasar-ui-qmarkdown

A Quasar UI App Extension to display inline markdown
https://quasarframework.github.io/quasar-ui-qmarkdown/
MIT License
157 stars 28 forks source link

Copy to clipboard includes code line numbers #393

Open jaimehrubiks opened 6 months ago

jaimehrubiks commented 6 months ago

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)}}



**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