Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“Copy to clipboard” button adds extra lines into the copied text #34447

Closed
hackertron opened this issue Jun 21, 2022 · 21 comments
Closed

“Copy to clipboard” button adds extra lines into the copied text #34447

hackertron opened this issue Jun 21, 2022 · 21 comments
Assignees
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@hackertron
Copy link

This is a Bug Report

Problem: copy to clipboard functionality has an issue. Whenever you copy the yaml file it adds extra spaces. e.g. go to this yaml https://kubernetes.io/docs/concepts/services-networking/network-policies/#networkpolicy-resource and copy the yaml using the button. it will be like this

apiVersion: networking.k8s.io/v1

kind: NetworkPolicy

metadata:

  name: test-network-policy

  namespace: default

spec:

  podSelector:

    matchLabels:

      role: db

  policyTypes:

    - Ingress

    - Egress

  ingress:

    - from:

        - ipBlock:

            cidr: 172.17.0.0/16

            except:

              - 172.17.1.0/24

        - namespaceSelector:

            matchLabels:

              project: myproject

        - podSelector:

            matchLabels:

              role: frontend

      ports:

        - protocol: TCP

          port: 6379

  egress:

    - to:

        - ipBlock:

            cidr: 10.0.0.0/24

      ports:

        - protocol: TCP

          port: 5978


when it should be like this

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-network-policy
  namespace: default
spec:
  podSelector:
    matchLabels:
      role: db
  policyTypes:
    - Ingress
    - Egress
  ingress:
    - from:
        - ipBlock:
            cidr: 172.17.0.0/16
            except:
              - 172.17.1.0/24
        - namespaceSelector:
            matchLabels:
              project: myproject
        - podSelector:
            matchLabels:
              role: frontend
      ports:
        - protocol: TCP
          port: 6379
  egress:
    - to:
        - ipBlock:
            cidr: 10.0.0.0/24
      ports:
        - protocol: TCP
          port: 5978

Proposed Solution:
fix the extra space/markdown when using copy to clipboard.

Page to Update:
https://kubernetes.io/...

@hackertron hackertron added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 21, 2022
@k8s-ci-robot
Copy link
Contributor

@hackertron: This issue is currently awaiting triage.

SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jihoon-seo
Copy link
Member

For me, this is reproducible, and my environment is:

  • Windows 11 (64-bit)
  • Google Chrome 102.0.5005.115 (64-bit)

@Kartik494
Copy link
Contributor

@jihoon-seo i too found this issue ,it's showing space in yaml file after copying into machine.
i am using Ubuntu.

@dhanraj322
Copy link

@hackertron @jihoon-seo I'm new to the open source world and would love to get started with contributions. Is it alright if I assign this issue to myself ?

@dhanraj322
Copy link

dhanraj322 commented Jun 22, 2022

This is reproducible for me on following environments:

  • macOS 12.4 + Safari 15.5
  • Ubuntu 20.04.4 LTS + Chrome 102.0.5005.115

Also found similar issue for this yaml https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#exposing-pods-to-the-cluster

@dhanraj322
Copy link

/assign

@ayushtamra
Copy link

/assign

@jihoon-seo
Copy link
Member

/unassign @dhanraj322

@hackertron
Copy link
Author

Now it looks like the spaces are included in the markdown also : https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables

@ayushtamra
Copy link

ayushtamra commented Jun 24, 2022

Hi, anyone having idea how can we approach this issue, from my observation the spaces are being added when the markdown is built. I am a new contributor so if anyone could help me i would be grateful

@sftim
Copy link
Contributor

sftim commented Jun 27, 2022

Could we change the JavaScript to fetch the source document and then copy that fetched source document into the clipboard?

That'd be tidy if we can.

@sftim
Copy link
Contributor

sftim commented Jun 27, 2022

/area web-development

@k8s-ci-robot k8s-ci-robot added the area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes label Jun 27, 2022
@sftim
Copy link
Contributor

sftim commented Jun 27, 2022

/retitle “Copy to clipboard” button adds extra lines into the copied text

@k8s-ci-robot k8s-ci-robot changed the title copy to clipboard button adds extra spaces in the yaml “Copy to clipboard” button adds extra lines into the copied text Jun 27, 2022
@sftim
Copy link
Contributor

sftim commented Jun 27, 2022

This feels like a cosmetic bug
/priority backlog

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 25, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 25, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-ci-robot k8s-ci-robot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2022
@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

@divya-mohan0209: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot reopened this Dec 28, 2022
@divya-mohan0209
Copy link
Contributor

Since there is a dupe issue opened for tracking this, I'm closing this one out.
/close

@k8s-ci-robot
Copy link
Contributor

@divya-mohan0209: Closing this issue.

In response to this:

Since there is a dupe issue opened for tracking this, I'm closing this one out.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
9 participants