# Backticks not transferred when quoting only the code span

**URL:** https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517
**Category:** Bug
**Created:** [October 15, 2018, 7:03am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517 "2018-10-15T07:03:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [October 15, 2018, 7:03am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/1 "2018-10-15T07:03:28Z")

</div>

I’ve noticed that backticks that denote [code spans](https://spec.commonmark.org/0.28/#code-spans) are not part of the quoted text when creating a quote. This is relevant where special characters are used that are treated differently depending whether they’re used inside a code span or not.

**Example**

The original text

`%APPDATA%\%TEST%\test.txt`

when quoted, becomes

> [@](#):
>
> %APPDATA%%TEST%\test.txt

treating the first backslash as an escape for the following percent sign and resulting in a misquote, where the correct quote would be

> [@](#):
>
> `%APPDATA%\%TEST%\test.txt`

---

<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: [October 15, 2018, 7:15am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/2 "2018-10-15T07:15:41Z")

</div>

> [@fhe](#):
>
> The original text
> 
> `%APPDATA%\%TEST%\test.txt`

No repro, I just quoted and it looks fine to me.

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [October 15, 2018, 7:28am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/3 "2018-10-15T07:28:09Z")

</div>

> [@fhe](#):
>
> %APPDATA%%TEST%\test.txt

You need to quote the code span only for reproducing the issue.

---

<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: [October 15, 2018, 7:36am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/4 "2018-10-15T07:36:56Z")

</div>

That’s a very .. specific .. scenario. I edited your topic title to make it more clear.

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [October 15, 2018, 7:44am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/5 "2018-10-15T07:44:57Z")

</div>

It happens quite often in my community, resulting in follow-up posts where users state that the "" was somehow omitted (that’s actually `"\"`) which then results in even more confusion.

And regarding the original topic title: it also happens when quoting _from_ code spans, meaning that you don’t need to quote the complete code span. It happens also with parts of those.

---

<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: [May 5, 2019, 2:06am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/7 "2019-05-05T02:06:10Z")

</div>

> [@fhe](#):
>
> The original text
> 
> `%APPDATA%\%TEST%\test.txt`
> 
> when quoted, becomes

As long as you quote _enough_, thanks to @vinothkannans prior efforts enhancing Discourse to copy essential formatting in quotes, this is now working. 🙌

---

<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: [May 5, 2019, 2:06am UTC](https://meta.discourse.org/t/backticks-not-transferred-when-quoting-only-the-code-span/99517/8 "2019-05-05T02:06:28Z")

</div>


