Codeblock Quality Defect - Character encoding issues
Asked by Christopher Zack:

When creating a codeblock element and select "plain text," any special characters are encoded if they are wrapped in quotation marks. Most notably, the ampersand symbol (\&) will be outputted as \&amp; even though "Plain Text" was selected.


Answers:
author: Diego
body: Hello there, [@Christopher Zack](/t5/user/viewprofilepage/user-id/1873534) !

As I understand, ++*special characters are escaped inside the Codeblock Macro even though you selected Plain Text as format*++.

With this behavior in mind, I tried to replicate the issue locally. I was ultimately unable to. Here is a screen capture of my attempt:
> ![CodeBlockSpecialCharacters.gif](https://community.atlassian.com/t5/image/serverpage/image-id/77548iD03505DAA0B924CE/image-dimensions/563x271?v=v2 "CodeBlockSpecialCharacters.gif")

Since I was unable to replicate, I would like to take a deeper look into this behavior with you. Here are a few questions:
> 1. *Is this happening regardless of browser being used?*
> 2. *Is this issue affecting all Codeblock macros you placed?*
> 3. *Are you typing in the special characters or are you pasting them from somewhere else?*

Looking forward to your reply, Christopher!

comments: author: Christopher Zack
body: Hi Diego, here is an example to replicate this issue from. Doesn't seem to exclusively be ampersands inside quotation marks as something else is in play here but on publish (and preview), the ampersand becomes encoded:

```
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? 
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; 
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; 
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, 
document,'script','//connect.facebook.net/en_US/fbevents.js');

fbq('init', '123456789'); 
fbq('track', "PageView");</script> 
<noscript><img height="1" width="1" style="display:none" 
src="https://www.facebook.com/tr?id=691433037612974&ev=PageView&noscript=1" 
/></noscript>
<!-- End Facebook Pixel Code -->
```

1. I was able to replicate this issue in Chrome and Firefox.
2. Plain Text, PHP, HTML/XML and a few others also encountered this issue.
3. Copying and Pasting code from Notepad to strip formatting.

Here is an additional screenshot of the issue: <https://www.screencast.com/t/00S1uNlpYx>

Hope this is helpful!


author: Diego
body: Hey [@Christopher Zack](/t5/user/viewprofilepage/user-id/1873534) , thanks for the quick feedback on the issue!

Interesting to see your results. Here is what I see in both Firefox and Chrome:
> ![CodeBlockSecondTest-min.gif](https://community.atlassian.com/t5/image/serverpage/image-id/77572i691AE583ABB75145/image-dimensions/501x241?v=v2 "CodeBlockSecondTest-min.gif")

Here is my environment:

![Anota??o 2020-01-02 131950.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/77574i17CA468D30567CAA/image-dimensions/215x140?v=v2 "Anota??o 2020-01-02 131950.jpg")

![Anota??o 2020-01-02 131945.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/77573iCDF894310AB08D77/image-dimensions/214x78?v=v2 "Anota??o 2020-01-02 131945.jpg")

![Anota??o 2020-01-02 131938.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/77575i778B4128A276AAF1/image-dimensions/214x109?v=v2 "Anota??o 2020-01-02 131938.jpg")

Could you give more details on the Browser version and operating system? We need to better understand and try to replicate it.

If we are able to replicate the behavior, we can file a report to try and tackle the issue!

Let us hear from you.


author: Christopher Zack
body: Google Chrome:  
Version 79.0.3945.88 (64-bit)

Firefox:  
71.0 (64-bit)


author: Christopher Zack
body: Windows specifications

Edition: Windows 10 Enterprise

Version: 1809

OS build: 17763.379


Tags: cloud

confluence-cloud