# Code in Copy pasted HTML appears outside code blocks

**URL:** <https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333>\
**Category:** Bugs & Issues\
**Created:** [October 26, 2023, 10:32am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333 "2023-10-26T10:32:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [October 26, 2023, 10:32am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/1 "2023-10-26T10:32:10Z")

</div>

Fibery rich text fields distort pasted HTML such that code appears outside code blocks. The use case here is that complete ChatGPT conversations (or other complete texts that contain code blocks) maintain their code block formatting correctly. So I’m not interested in manually copy pasting every code block.

### Copied HTML (select all text including code blocks, then copy)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/f/f9cd16ab8cc90d4bf1c64df5f0126488bcdabd78.png)

### Result of pasted HTML in Fibery rich text field:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/61a7edb0c050cd494e1ecd3f8e9d711d3f29dd4e.png)

### It should appear like the result of pasted HTML in a Notion page:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/e/ed3db576b56973d8ed47544046d9166473cff4cb.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 26, 2023, 10:35am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/2 "2023-10-26T10:35:02Z")

</div>

What did you highlight (on the ChatGPT page) before using copy paste?

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [October 26, 2023, 10:37am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/3 "2023-10-26T10:37:51Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/a/a6697f18084e47b29c3a1f1aa507e85b2c5f3aad.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 26, 2023, 10:41am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/4 "2023-10-26T10:41:42Z")

</div>

When I do something similar, the output is pretty much what I would expect:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/d/de2204e24d36dcc2de23a94123c5569f3aed758e.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/3/3bce59df56eb183451d1da3afad16c3afac515e3.png)

What browser/OS are you using and what is the copy-paste result into other applications, e.g. Word?

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [October 26, 2023, 10:42am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/5 "2023-10-26T10:42:50Z")

</div>

The copy pasting is actually a workaround for the inability of Fibery to display markdown in rich text fields.  
I will check your suggestion now…

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 26, 2023, 10:48am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/6 "2023-10-26T10:48:51Z")

</div>

> [@Yuri\_BC](#):
>
> the inability of Fibery to display markdown in rich text

WDYM?  
Fibery can display markdown no problem.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/620491a70ef067d0c37fed63ce2414458182ca75.png)

Do you mean that markdown which is directly pasted into a rich text field is not automatically converted into formatted text?

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [October 26, 2023, 11:03am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/7 "2023-10-26T11:03:31Z")

</div>

Yes, that is what I mean, that it does not convert automatically to formatted text.

But apart from that, my issue with copy pasting mixed text and code blocks still persistst. I am using Chrome, and tested with Microsoft Edge also, in both cases when copy pasting mixed text and code blocks into fibery, the code blocks are not correctly formatted as result.

 ![EqajVfrg2N](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/8ca9784fac540b5d9579ff3b77e66b9dabb17400.png)

## Fibery rich text field

 ![chrome_4plCzsFxR6](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/8654e0b0581b1811fee0c13bc57bfbd6ac621256.png)

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [October 26, 2023, 11:08am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/8 "2023-10-26T11:08:05Z")

</div>

I tested it with a regular fibery support page copy paste, and the issue does not happen there.

So it apparently has to do with how ChatGPT formats its code blocks such that it confuses Fibery.  
Hower, Notion and coda (see below) seem not to have the same issue:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/96cdeb590ecd11355f62960e8117e4a44a98547c.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 26, 2023, 11:10am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/9 "2023-10-26T11:10:33Z")

</div>

With a bit of experimenting I found that it works not so well when Chrome is used for copying from the OpenAI source.  
Copying from Firefox (into Fibery in FF or Chrome) works fine.

Browser standardisation? 🙄

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [October 26, 2023, 11:20am UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/10 "2023-10-26T11:20:01Z")

</div>

> [@Chr1sG](#):
>
> Copying from Firefox (into Fibery in FF or Chrome) works fine.

I confirm that in Firefox copy pasting works fine in Fibery.

---

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [January 22, 2024, 7:50pm UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/11 "2024-01-22T19:50:54Z")

</div>

It stays an issue…even when using Firefox to copy and paste in either Firefox or chrome, the code is indeed in a codeblock but the programming language label is above it also in a code block:

 ![chrome_i3TkRlQSyO](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/e/e13663289610128a0ea0058c87968e6ef56d133d.png)

---

<div class="post-metadata">

**Author:** ![helloitse](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/helloitse/32/498_2.png) [@helloitse](https://community.fibery.io/u/helloitse)\
**Post date:** [September 12, 2024, 1:13pm UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/12 "2024-09-12T13:13:06Z")

</div>

@Yuri_BC I have a related question. This past week when pasting html code into a code block I could not see html as a formatting option.  
Did it used to exist?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [September 12, 2024, 1:40pm UTC](https://community.fibery.io/t/code-in-copy-pasted-html-appears-outside-code-blocks/5333/13 "2024-09-12T13:40:19Z")

</div>

> [@helloitse](#):
>
> Did it used to exist?

It still exists:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/f/f1e21e159f42c96a93ce985292ea063f20818c79.png)
