# Discobot e copiar e colar um link

**URL:** https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504
**Category:** Bug
**Created:** [Outubro 28, 2020, 10:06am UTC](https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504 "2020-10-28T10:06:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [Outubro 28, 2020, 10:06am UTC](https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504/1 "2020-10-28T10:06:56Z")

</div>

Um dos passos do discobot pede para fazer o upload de uma imagem. Quando isso falha por algum motivo, ele sugere um link para ser usado para esse fim. Até aqui, tudo bem.

O problema é que o link fornecido está entre crases. Dependendo de como a URL é copiada e colada, as crases podem ser copiadas também, resultando em uma postagem que parece fazer exatamente o que é solicitado, mas ainda assim não funciona.

 ![Screenshot 2020-10-28 at 09.55.43](https://global.discourse-cdn.com/meta/original/3X/9/8/9868f30e3af5ca94e80b90f665b4c67b21785c4a.png)

Para administradores, isso pode ser visto [aqui](https://meta.discourse.org/t/greetings/95761/16).

Acho que, se a seleção de cópia for feita começando na linha (em branco) acima até a linha (em branco) abaixo, o estilo também é _copiado_. Talvez o link possa ser colocado [entre colchetes](https://meta.discourse.org/t/url-parsing-on-posts/166851/4?u=mentalstring) (\<\>) para evitar isso e a pré-visualização?

Obviamente, isso é algo muito pequeno, mas acho que qualquer coisa que possa reduzir a fricção ao ajudar os recém-chegados a começar por conta própria só pode ajudar a todos.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Outubro 28, 2020, 10:48pm UTC](https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504/2 "2020-10-28T22:48:10Z")

</div>

@riking, você se importaria de dar uma olhada nisso, já que você estava lá recentemente?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [Outubro 29, 2020, 1:29pm UTC](https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504/4 "2020-10-29T13:29:33Z")

</div>

> [@mentalstring](#):
>
> Talvez o link possa ser colocado [entre colchetes](https://meta.discourse.org/t/url-parsing-on-posts/166851/4) (\<\>) para evitar isso e a prévia?

Sim, essa foi a solução que adotei (após investigar a possibilidade de remover automaticamente os acentos graves de código).

> <https://github.com/discourse/discourse/pull/11063>
>
> Due to the new enhanced copy-paste handling, the URL would be included in the us…er's reply as code, too!
> By surrounding the link in angle brackets, we prevent the bot from accidentally including the link itself and spoiling the surprise.
> 
> I considered having the bot automatically edit the user's post to remove the backticks. I very quickly ran into a problem with spurious whitespace, and it would also look \_super weird\_ for the bot to edit your post when that's not what's being taught.
> The seemingly bare link not automatically embedding is also weird, but slightly less so.
> 
> Fun fact: this doesn't work on localhost, because the onebox engine refuses to issue requests to localhost :)
> 
> 
> 
> Note: this change will need to percolate to translations, but let's let that happen naturally.

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [Outubro 29, 2020, 4:41pm UTC](https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504/5 "2020-10-29T16:41:09Z")

</div>

Obrigado pela correção rápida!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Outubro 31, 2020, 1:00am UTC](https://meta.discourse.org/t/discobot-and-copy-pasting-a-link-step/168504/6 "2020-10-31T01:00:06Z")

</div>

Este tópico foi fechado automaticamente após 33 horas. Novas respostas não são mais permitidas.
