Skip to content

bug report: clipboard-copy function #168

Open
@ycyaoxdu

Description

@ycyaoxdu
Member

While using the copy function for coping the code snippet, I found it doesn't works properly:

When i clicked the copy of step 2 code snippet 1 here, what i get in my clipboard is :

$ kubectl -n open-cluster-management   get pod   --context ${CTX_HUB_CLUSTER}
NAME                               READY   STATUS    RESTARTS   AGE
cluster-manager-695d945d4d-5dn8k   1/1     Running   0          19d

the non-command lines which don't start with a $ is also been copied.

I'm wondering that if it is ok for just add a judgment rule to the copy function to determine whether the line is stared with $ which means that it is a command should be copied.

Activity

qiujian16

qiujian16 commented on Dec 7, 2021

@qiujian16
Member

/assign @morvencao

morvencao

morvencao commented on Dec 7, 2021

@morvencao
Member

@ycyaoxdu It's not hard to trim the prompt character $, but what about the command output?
A better solution IMO would be putting the command itself and command output in different html element.

/enhance

morvencao

morvencao commented on Dec 7, 2021

@morvencao
Member

And also what if we have multiple commands in a code block, for example:

$ echo "Hello" >file.txt
$ cat file.txt
Hello
xuezhaojun

xuezhaojun commented on Dec 15, 2024

@xuezhaojun
Member

@morvencao Is this considered done?

morvencao

morvencao commented on Dec 16, 2024

@morvencao
Member

not yet, I will find time for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @qiujian16@morvencao@xuezhaojun@ycyaoxdu

      Issue actions

        bug report: clipboard-copy function · Issue #168 · open-cluster-management-io/open-cluster-management-io.github.io