# Copy pasting build output into GitHub break formatting

**URL:** <https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491>\
**Category:** Features Requests\
**Created:** [January 17, 2024, 9:12am UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491 "2024-01-17T09:12:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![byroot](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/byroot/32/1400_2.png) [@byroot](https://forum.buildkite.community/u/byroot)\
**Post date:** [January 17, 2024, 9:12am UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/1 "2024-01-17T09:12:56Z")

</div>

Using a public build as an example: [Rails #104016](https://buildkite.com/rails/rails/builds/104016)

```auto
17 01 2024 03:20:20.700:ERROR [karma-server]: Error: [init({"version":"70","platform":"ANY","tags":[],"name":"ActionCable JS Client","tunnel-identifier":"karma1705461603","record-video":false,"record-screenshots":false,"device-orientation":null,"disable-popup-handler":true,"build":"Buildkite 018d155d-c0f8-459f-972b-4546f68e8c28","public":null,"commandTimeout":300,"idleTimeout":90,"maxDuration":1800,"customData":{},"base":"SauceLabs","browserName":"chrome"})] The environment you requested was unavailable.
Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/5cd54c0077b54e718a62fe4008ea84f7
    at /rails/node_modules/wd/lib/webdriver.js:157:15
    at Request._callback (/rails/node_modules/wd/lib/http-utils.js:89:7)
    at self.callback (/rails/node_modules/request/request.js:185:22)
    at Request.emit (node:events:517:28)
    at Request.<anonymous> (/rails/node_modules/request/request.js:1161:10)
    at Request.emit (node:events:517:28)
    at IncomingMessage.<anonymous> (/rails/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (node:events:631:28)
    at IncomingMessage.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  data: '{"status": 13, "sessionId": "5cd54c0077b54e718a62fe4008ea84f7", "value": {"message": "Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/5cd54c0077b54e718a62fe4008ea84f7"}}'
}

```

If I copy paste this in GitHub comment it turns into:

```auto

17 01 2024 03:20:20.700:ERROR [karma-server]: Error: [init({"version":"70","platform":"ANY","tags":[],"name":"ActionCable JS Client","tunnel-identifier":"karma1705461603","record-video":false,"record-screenshots":false,"device-orientation":null,"disable-popup-handler":true,"build":"Buildkite 018d155d-c0f8-459f-972b-4546f68e8c28","public":null,"commandTimeout":300,"idleTimeout":90,"maxDuration":1800,"customData":{},"base":"SauceLabs","browserName":"chrome"})] The environment you requested was unavailable.
--
  | Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/5cd54c0077b54e718a62fe4008ea84f7
  | at /rails/node_modules/wd/lib/webdriver.js:157:15
  | at Request._callback (/rails/node_modules/wd/lib/http-utils.js:89:7)
  | at self.callback (/rails/node_modules/request/request.js:185:22)
  | at Request.emit (node:events:517:28)
  | at Request.<anonymous> (/rails/node_modules/request/request.js:1161:10)
  | at Request.emit (node:events:517:28)
  | at IncomingMessage.<anonymous> (/rails/node_modules/request/request.js:1083:12)
  | at Object.onceWrapper (node:events:631:28)
  | at IncomingMessage.emit (node:events:529:35)
  | at endReadableNT (node:internal/streams/readable:1400:12)
  | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  | data: '{"status": 13, "sessionId": "5cd54c0077b54e718a62fe4008ea84f7", "value": {"message": "Sauce could not start your job. For more information on what happened, please visit https://app.saucelabs.com/tests/5cd54c0077b54e718a62fe4008ea84f7"}}'
  | }

```

(notice the extra `|`) which result in a hard to read comment:

 ![Capture d’écran 2024-01-17 à 10.12.06](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/2X/b/ba5a988da40934746f97668e433314787fb7f582.png)

---

<div class="post-metadata">

**Author:** ![tomwatt](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tomwatt](https://forum.buildkite.community/u/tomwatt)\
**Post date:** [January 17, 2024, 9:58am UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/2 "2024-01-17T09:58:08Z")

</div>

Hey @byroot

Welcome to the Buildkite Community Forums!

That an interesting oberservation there and I’ve tried using the Build logs you’ve shared to try and reproduce it on MacOS but without success.

Are you seeing the extra `|` being added when pasting elsewhere other than GitHub?  
Additionally, is it being pasted with or without formatting? I know different Operating Systems handle formatting of text differently.

Cheers,

Tom

---

<div class="post-metadata">

**Author:** ![byroot](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/byroot/32/1400_2.png) [@byroot](https://forum.buildkite.community/u/byroot)\
**Post date:** [January 17, 2024, 3:50pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/3 "2024-01-17T15:50:12Z")

</div>

Right, I should have included platform information.

I’m on macOS too, using Google chrome (version likely don’t matter has this issue has been pretty much forever).

> Are you seeing the extra `|` being added when pasting elsewhere other than GitHub?

Not that I can remember, I rarely post code elsewhere though.

> is it being pasted with or without formatting?

That’s not something I’m familiar with. I just cmd+c and cmd+v, whatever the default macOS setting is, it’s likely the one I run.

Also I workaround this by first pasting in an editor, copying again from there and then pasting in github.

---

<div class="post-metadata">

**Author:** ![byroot](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/byroot/32/1400_2.png) [@byroot](https://forum.buildkite.community/u/byroot)\
**Post date:** [January 17, 2024, 3:53pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/4 "2024-01-17T15:53:20Z")

</div>

Alright, this prompted me to test more.

I tried from Firefox, and indeed no problem there. I also tried copying from Chrome and pasting in Firefox, and the output was impacted.

So it seem exclusive to Chrome’s copy, it’s likely trying to copy it as some form of rich text.

---

<div class="post-metadata">

**Author:** ![tomwatt](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tomwatt](https://forum.buildkite.community/u/tomwatt)\
**Post date:** [January 17, 2024, 4:03pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/5 "2024-01-17T16:03:10Z")

</div>

Cheers for the reply and testing @byroot !

That’s a good find, I never expected a web browser to affect the formatting of text but there is probably a reason of why Chrome is doing it.

Let us know if you notice anything else strange or have any issue with Buildkite!

Cheers,

Tom

---

<div class="post-metadata">

**Author:** ![byroot](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/byroot/32/1400_2.png) [@byroot](https://forum.buildkite.community/u/byroot)\
**Post date:** [January 17, 2024, 5:10pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/6 "2024-01-17T17:10:43Z")

</div>

Well, I’m pretty much stuck with Chrome at work, so switching browsers isn’t really an option for me.

---

<div class="post-metadata">

**Author:** ![byroot](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/byroot/32/1400_2.png) [@byroot](https://forum.buildkite.community/u/byroot)\
**Post date:** [January 17, 2024, 5:16pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/7 "2024-01-17T17:16:58Z")

</div>

Ok, so copy pasting into Google Docs generate a single column table, and inspecting the buildkite output shows the rendering is done with tr/td (HTML table), so that is likely what’s going on here.

The output is copied as rich (HTML?) text, and GitHub comment editor accept rich paste and tries to turn it into a Markdown table (`|`).

But I’m not aware of any way to prevent chrome from doing a rich copy 😕 aside from not using tables to render output, but I get that’s not trivial.

---

<div class="post-metadata">

**Author:** ![tomwatt](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tomwatt](https://forum.buildkite.community/u/tomwatt)\
**Post date:** [January 17, 2024, 5:43pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/8 "2024-01-17T17:43:34Z")

</div>

Hey @byroot

I can confirm that the Build Log Output is rendered on the UI to HTML using our terminal-to-html tool.

> **[GitHub - buildkite/terminal-to-html: Converts arbitrary shell output (with...](https://github.com/buildkite/terminal-to-html)**
>
> Converts arbitrary shell output (with ANSI) into beautifully rendered HTML - GitHub - buildkite/terminal-to-html: Converts arbitrary shell output (with ANSI) into beautifully rendered HTML

Looking into this for you, you could either use the Raw Log output to have the logs in plaintext. Though that will have some character encoding in it.

Alternatively, when copying and pasting the HTML rendered output, you can Paste and Match Style on MacOS with SHIFT+CMD+V.

To keep the general formatting, would recommending putting the output in a markdown code block.

Hope that helps.

Tom

---

<div class="post-metadata">

**Author:** ![byroot](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/byroot/32/1400_2.png) [@byroot](https://forum.buildkite.community/u/byroot)\
**Post date:** [January 17, 2024, 5:57pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/9 "2024-01-17T17:57:00Z")

</div>

Oh! TIL about SHIFT+CMD+V, thanks a lot!

---

<div class="post-metadata">

**Author:** ![tomwatt](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tomwatt](https://forum.buildkite.community/u/tomwatt)\
**Post date:** [January 17, 2024, 6:06pm UTC](https://forum.buildkite.community/t/copy-pasting-build-output-into-github-break-formatting/3491/10 "2024-01-17T18:06:54Z")

</div>

Hey @byroot

No problems, happy to help! 🙌

Cheers,

Tom
