arronhunt / highlightjs-copy

📋❇️ A simple, accessible highlightjs plugin to add a copy button to your code blocks.

Home Page:https://highlightjs-copy.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The first line is a Redundant Blank line

hopana opened this issue · comments

When click the copy button, I get the content of the code, but, The first line is always a Redundant Blank line
highlightjs: v11.5.1
highlightjs-copy: 1.03

image

an example of the copied content like this

I figure out this has nothing to do with highlightjs-copy.js, this issue will be close

em......I use a linenumber plugin:https://github.com/wcoder/highlightjs-line-numbers.js
I'm not sure that has anything to do with it.
but, why I use another copy plugin, there is no blank first line?

when i manul trim then content text like this: navigator.clipboard.writeText(newText.trim()), it works. no blank first line anymore.