# HTML/RTF pasting

**URL:** https://meta.discourse.org/t/html-rtf-pasting/55913
**Category:** Feature
**Created:** [2017年一月17日 16:40 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913 "2017-01-17T16:40:05Z")
**Posts on this page:** 20
**Page:** 3

<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: [2017年十二月8日 21:36 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/52 "2017-12-08T21:36:35Z")

</div>

There is a built in browser feature which already does what you want. Has nothing to do with Discourse.

> Press Ctrl+Shift+V to Paste Text Without Formatting in Google Chrome. Text pasted into your browser, when using a rich text editor like the one found in Gmail, automatically takes on the formatting of the source text.

Source: [Google Chrome Blog: Tip: Just the text, please!](https://chrome.googleblog.com/2010/09/tip-just-text-please.html)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2018年一月10日 12:07 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/53 "2018-01-10T12:07:53Z")

</div>

18 posts were split to a new topic: [Help us to test the HTML pasting](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661)

---

<div class="post-metadata">

### Author: ![dalerka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalerka/32/120265_2.png) [@dalerka](https://meta.discourse.org/u/dalerka)
#### Post date: [2017年十二月24日 12:25 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/71 "2017-12-24T12:25:14Z")

</div>

Thank you for working on this cool feature!  
I’ve noticed that when you copy and paste some content from a web page that has text and images, the following happens:

- the text formatting works well
- however images show as a broken image icons
- some time after saving such post, the “System” user makes an edit to re-upload the images and those images show up well.

It was pretty confusing to see that the images don’t show up and I tried several times, which is bad for UX.  
Would it be possible to trigger image uploads immediately after pasting the text into _Composer_?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2017年十二月24日 12:33 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/72 "2017-12-24T12:33:46Z")

</div>

Sure. Can you share a example web content (URL) where you facing this problem?

---

<div class="post-metadata">

### Author: ![dalerka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalerka/32/120265_2.png) [@dalerka](https://meta.discourse.org/u/dalerka)
#### Post date: [2017年十二月25日 05:41 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/73 "2017-12-25T05:41:52Z")

</div>

Yep. Here’s an example:  
I copied the header and the first image and below you can see how it looks like when pasted (image doesn’t show up, only icon). [Source.](https://www.sbfi.admin.ch/sbfi/en/home/bildung/scholarships-and-grants/swiss-government-excellence-scholarships-for-foreign-scholars-an.html)

# Swiss Government Excellence Scholarships for Foreign Scholars and Artists for the 2018–2019 Academic Year

 ![](https://global.discourse-cdn.com/meta/original/3X/f/1/f161dae3b10c9cc21e82120f7013f7490a41fe4e.png)

Preview:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/7/27bd0399dc16ffe2979eb81a73d3b4b712830511.png)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2017年十二月25日 06:59 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/74 "2017-12-25T06:59:48Z")

</div>

![copy-image](https://global.discourse-cdn.com/meta/original/3X/8/0/8050d6ee64a6d4dd0fd3b1e1bbe73e5f69af3bfd.jpg)

I am unable to reproduce it both here in meta and in my development environment. Also checked in Chrome, Firefox and IE. May I know which browser and OS you are using.

---

<div class="post-metadata">

### Author: ![dalerka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalerka/32/120265_2.png) [@dalerka](https://meta.discourse.org/u/dalerka)
#### Post date: [2017年十二月25日 10:59 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/75 "2017-12-25T10:59:08Z")

</div>

I see… I’m on MX Linux and using latest Chromium and Firefox, and I can reproduce repeatedly (here on _meta_ too). Thanks for checking, and let me know if I can help test this otherwise. 🤔

---

<div class="post-metadata">

### Author: ![trudat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trudat/32/104354_2.png) [@trudat](https://meta.discourse.org/u/trudat)
#### Post date: [2018年一月12日 19:22 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/76 "2018-01-12T19:22:56Z")

</div>

So is HTML-to-Markdown copy-paste a built-in feature now?  
No plugins or shortcut keys needed?

It doesn’t seem to be working on my site.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2018年一月12日 19:29 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/77 "2018-01-12T19:29:44Z")

</div>

it’s a beta feature so needs to be enabled in the admin settings.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2018年三月22日 04:20 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/78 "2018-03-22T04:20:35Z")

</div>

@vinothkannans we got to look at improving internal usage, cause it really can muck stuff up when you cut and paste between posts 💥

* * *

[@vinothkannans](https://meta.discourse.org/u/vinothkannans) we got to look at improving internal usage, cause it really can muck stuff up when you cut and paste between posts ![:boom:](https://global.discourse-cdn.com/meta/images/emoji/twitter/boom.png?v=5)

`[@vinothkannans](https://meta.discourse.org/u/vinothkannans) we got to look at improving internal usage, cause it really can muck stuff up when you cut and paste between posts ![:boom:](https://global.discourse-cdn.com/meta/images/emoji/twitter/boom.png?v=5)`

---

<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: [2018年三月22日 04:33 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/79 "2018-03-22T04:33:09Z")

</div>

Internal use should be prioritized, for sure.. we don’t want to make Discourse-to-Discourse copying and pasting worse.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [2018年四月28日 11:38 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/80 "2018-04-28T11:38:20Z")

</div>

Using the test document for [HTML/RTF paste on Discourse](https://meta.discourse.org/t/html-rtf-pasting/55913/22).

I feel like this part used to work and no longer does:

Italicised text with some random bold words.

(instead of)

_Italicised text with **some random** bold words._

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2018年四月28日 18:24 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/81 "2018-04-28T18:24:58Z")

</div>

Google Doc’s way of styling is changed I guess. Let me check.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2018年八月30日 08:37 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/82 "2018-08-30T08:37:38Z")

</div>

> [@sam](#):
>
> @vinothkannans we got to look at improving internal usage, cause it really can muck stuff up when you cut and paste between posts 💥

It’s fixed. Emojis are now displaying properly. And the click counts are removed from links.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2018年八月30日 20:42 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/83 "2018-08-30T20:42:03Z")

</div>

> [@mcwumbly](#):
>
> Using the test document for [HTML/RTF paste on Discourse](https://meta.discourse.org/t/html-rtf-pasting/55913/22).
> 
> I feel like this part used to work and no longer does:

> [@Help us to test the HTML pasting](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/1):
>
> #### Current Limitations
> 
> - Not converting style attributes to Markdown. (like `style="font-weight: bold"` )

Now they using style attributes instead of `em` and `strong` tags ☹.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2018年十月1日 23:40 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/84 "2018-10-01T23:40:12Z")

</div>

@vinothkannans I’ve noticed what I think is a bug in the HTML copy/paste. When I copy less than (\<) and greater than (\>) symbols, it pastes them as &lt; and &gt;. Other characters like single quote (') and double quote (") aren’t escaped, so I found it odd that these were.

From writing this post I also realized that ampersand (&) has the same problem.

---

<div class="post-metadata">

### Author: ![Muiren](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/muiren/32/548809_2.png) [@Muiren](https://meta.discourse.org/u/Muiren)
#### Post date: [2018年十月2日 00:45 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/85 "2018-10-02T00:45:07Z")

</div>

I just composed and pasted a post from Google Docs into this forum elsewhere and while it strips anything not markdown translatable, bold, italics, and links are delivered flawlessly.

---

<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: [2018年十月2日 00:45 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/86 "2018-10-02T00:45:31Z")

</div>

Not a bug, you need to escape those otherwise you’re posting HTML. Which is valid. I can type

> This is **bold**

And it is

`> This is <b>bold</b>`

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2018年十月2日 01:31 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/87 "2018-10-02T01:31:09Z")

</div>

Yeah, I see what you mean, for the general case. However, I have a specific case where I think it’s not ideal. When people put HTML inside of formatted text, I think it’s often so that it can be used as a template and copied and pasted unescaped. We recently had a case like this, where we were showing off the new `ruby` tag support. For example:

```plaintext
<ruby>漢<rt>かん</rt></ruby><ruby>字<rt>じ</rt></ruby>

```

In such a case, I think it would be appropriate to not escape it.

**Current behavior on paste:**  
\<ruby\>漢\<rt\>かん\</rt\>\</ruby\>\<ruby\>字\<rt\>じ\</rt\>\</ruby\>

**Desired behavior on paste:**  
漢かん字じ

Basically, I would argue that anything in an inline code block `like this` or multiline code block

```plaintext
like this

```

should not be escaped when pasted. I think the average user doesn’t know about the paste as plain text option, so I don’t think it’s an acceptable workaround.

What do you think?

---

<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: [2018年十月2日 01:36 UTC](https://meta.discourse.org/t/html-rtf-pasting/55913/88 "2018-10-02T01:36:45Z")

</div>

use ctrl+shift+v or the other standard built in browser “paste as plain text” keyboard shortcuts in that special case.

[上一頁](https://meta.discourse.org/t/html-rtf-pasting/55913.md?page=2)

[下一頁](https://meta.discourse.org/t/html-rtf-pasting/55913.md?page=4)
