# Help us to test the HTML pasting

**URL:** https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661
**Category:** Feature
**Tags:** feedback
**Created:** [December 22, 2017, 7:45am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661 "2017-12-22T07:45:38Z")
**Posts on this page:** 20
**Page:** 1

<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: [December 22, 2017, 7:45am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/1 "2017-12-22T07:45:38Z")

</div>

**We’ve done a big update in HTML pasting.**

_It is still an experiment feature only. You have to manually enable it via site setting **`enable_rich_text_paste`** to use it in your Discourse instances._

#### Available pasting options

> **Headings**
>
> # h1 Heading ![😎](https://global.discourse-cdn.com/meta/original/3X/8/3/83fde19a65de90b956969947c326ae3f2acc4746.png)
> 
> ## h2 Heading
> 
> ### h3 Heading
> 
> #### h4 Heading
> 
> ##### h5 Heading
> 
> ###### h6 Heading

> **Emphasis**
>
> **This is bold text**
> 
> **This is _bold+italic_ text**
> 
> _This is italic text_
> 
> _This is italic text_
> 
> ~~Strikethrough~~

> **Blockquotes**
>
> > Blockquotes can also be nested…
> > 
> > > …by using additional greater-than signs right next to each other…
> > > 
> > > > …or with spaces between arrows.

> **Lists**
>
> Unordered
> 
> - Create a list by starting a line with `+`, `-`, or `*`
> 
> - Sub-lists are made by indenting 2 spaces:
> 
> - Very easy!
> 
> Ordered
> 
> 1. Lorem ipsum dolor sit amet
> 
> 2. Consectetur adipiscing elit
> 
> 3. Integer molestie lorem at massa
> 
> 4. You can use sequential numbers…
> 
> 5. …or keep all the numbers as `1.`
> 
> Start numbering with offset:
> 
> 1. foo
> 2. bar

> **Code**
>
> Inline `code`
> 
> Indented code
> 
> ```plaintext
> // Some comments
> line 1 of code
> line 2 of code
> line 3 of code
> 
> ```
> 
> Block code “fences”
> 
> ```plaintext
> Sample text here...
> 
> ```
> 
> Syntax highlighting
> 
> ```plaintext
> var foo = function (bar) {
> return bar++;
> };
> 
> console.log(foo(5));
> 
> ```

> **Tables**
>
> | Option | Description |
> | --- | --- |
> | data | path to data files to supply the data that will be passed into templates. |
> | engine | engine to be used for processing templates. Handlebars is the default. |
> | ext | extension to be used for dest files. |

> **Links**
>
> [link text](http://dev.nodeca.com/)
> 
> - [Lycurgus v1.9](https://meta.discourse.org/t/discourse-version-1-9/61289)
> - [Lysias v2.0](https://en.wikipedia.org/wiki/Lysias)

> **Images**
>
> ![image](https://global.discourse-cdn.com/meta/original/3X/8/4/8433a0eeb8cb55484268469f52c461e2829e662a.png)

> **Allowed HTML tags**
>
> - `<ins>`
> - `<del>`
> - `<small>`
> - `<big>`

#### Current Limitations

- Not converting style attributes to Markdown. (like `style="font-weight: bold"`)

- Tables should have at least two rows and columns. Column count in 1st row shouldn’t lesser than other rows.

- Complex tables with nested formatting have [limited support](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/24).

- Copying ordered lists (`ol` tags) from MS Word have limited support. It will be treated same like `ul` tag.

**If HTML to Markdown conversion failed for any reason then it will automatically fallback to plain text pasting.**

---

<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: [December 22, 2017, 9:29am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/2 "2017-12-22T09:29:42Z")

</div>

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/53):
>
> It is still an experiment feature only. You have to manually enable it via site setting enable\_rich\_text\_paste to use it in your Discourse instances.

It is enabled here. I also made sure it is enabled at [try.discourse.org](http://try.discourse.org) as well so people can try it out there in the sandbox.

---

<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: [December 22, 2017, 10:41am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/3 "2017-12-22T10:41:50Z")

</div>

This feature is f\*n _delightful_. Excellent work.

---

<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: [December 22, 2017, 11:10am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/4 "2017-12-22T11:10:43Z")

</div>

Would be awesome if you can help try breaking it, I am running out of edge cases real quick 🙃

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [December 22, 2017, 12:34pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/5 "2017-12-22T12:34:48Z")

</div>

I aim to please, Sam.

Inline formatting from Google Docs doesn’t work. I hope the great Vinoth can dispel their dark magic. You can copy any bold or italic text from my [test document](https://docs.google.com/document/d/15k0dvOCpjBxuLza2-btEYG12pKwyBVonZMFQHHl1PJ8/) to test this.

Other than that, the only thing that didn’t seem to be working is merged table cells –  
but I don’t recall whether CommonMark even supports them (Pandoc did, but I couldn’t find a mention of this on the CommonMark site). So this is probably moot.

One thing that I’m not fond of in the current implementation is that it uses “loose” list items by default. I.e, this:

```plaintext
- List item 1

- List item 2

- List item 3

```

Instead of this:

```plaintext
- List item 1
- List item 2
- List item 3

```

I strongly prefer the latter over the former, which creates paragraphs in addition to list items. I have arguments in favor of my preference, but I realize that it is just that – a matter of taste/use cases/etc. If it’s not desirable to switch to the tight list items by default, is it possible to switch to offer an option to do so?

Edit: This.

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/55):
>
> This feature is f\*n delightful.

---

<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: [December 22, 2017, 12:59pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/6 "2017-12-22T12:59:34Z")

</div>

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/57):
>
> it uses “loose” list items by default

I agree lists should be tight by default @vinothkannans.

---

<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: [December 22, 2017, 1:13pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/7 "2017-12-22T13:13:36Z")

</div>

Okay I am going to tighten the list now.

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/57):
>
> Inline formatting from Google Docs doesn’t work.

This is because Google docs using `style` attributes instead of inline tags like `<b>, <i>, etc.,`. As I mentioned we are not supporting it currently. But it’s doable. So we may add support for that after we reach a stable position in this feature.

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/57):
>
> the only thing that didn’t seem to be working is merged table cells –  
> but I don’t recall whether CommonMark even supports them

Yes. It is tricky. Currently we are not supporting it. Let me check it with Markdown first.

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [December 22, 2017, 2:33pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/8 "2017-12-22T14:33:56Z")

</div>

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/59):
>
> This is because Google docs using style attributes instead of inline tags like \<b\>, \<i\>, etc.,. As I mentioned we are not supporting it currently. But it’s doable. So we may add support for that after we reach a stable position in this feature.

I knew there was some sorcery going on there! I didn’t realize that that’s what you were referring to. I would love to see this implemented sometime as copy-pasting from Google Docs is a common use case for us.

The merged table cells was mostly a “what if”, since Sam asked for edge cases. It’s not something that’s ever come up my use of Discourse. (I had trouble pasting a Google Doc table with merged cells in my CMS yesterday, which is what gave me the idea to try.)

---

<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: [December 22, 2017, 2:48pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/9 "2017-12-22T14:48:43Z")

</div>

I guess you will have more use cases for HTML pasting as a OP of this topic. So please feel free report bugs, post opinions and edge case problems.

Edit: @alehandrof fixed. Now lists are tightened by default.

---

<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: [December 22, 2017, 5:02pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/10 "2017-12-22T17:02:12Z")

</div>

this is fantabulous - so exciting.

One issue I came across today - I just updated to latest. Previously (last week? two weeks ago? don’t remember), copy/pasting formatted newsletters from google email into discourse posts worked as you’d expect, with all pictures and formatting. Now it just pastes in whatever text there was without any formatting. I tried several and got the same result. For example, the newsletter below which is just one big image with a bit of text at the bottom just pastes the text at the bottom with no image. Copy/pasting from [medium.com](http://medium.com) worked, so I can confirm the feature is working otherwise.

 ![38 AM](https://global.discourse-cdn.com/meta/original/3X/2/5/25ae7539e9e5d44fb63ad9b40ddc943f8b702a7e.jpg)

---

<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: [December 22, 2017, 5:12pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/11 "2017-12-22T17:12:43Z")

</div>

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/53):
>
> If HTML to Markdown conversion failed for any reason then it will automatically fallback to plain text pasting.

I guess this what happened. Is it working for other emails? (_other than newsletters?_). I will check in mine.

---

<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: [December 22, 2017, 5:27pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/12 "2017-12-22T17:27:12Z")

</div>

It does indeed work for bold and italics and a single image attached in an email.

---

<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: [December 22, 2017, 6:28pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/13 "2017-12-22T18:28:11Z")

</div>

Yes. I am able to reproduce it. Thanks for your report. I am checking it.

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [December 24, 2017, 5:36am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/14 "2017-12-24T05:36:08Z")

</div>

This is not an improvement wrt Microsoft Word, which uses classes for things like lists instead of tags like `<ul>` and `<ol>`. Why? must ask Microsoft…

It would definitely be a big plus to get Word working… Word and Docs are the two most popular word processors in the world…

EDIT: Check out [HTML EDITOR.in: Free Online WYSIWYG HTML and HTML5 Editor](http://htmleditor.in/index.html) which seems to have it working. It converted from complex Word documents quite fine!

Ironically, this version: [HTML EDITOR.in: Free Online WYSIWYG HTML Editor](http://htmleditor.in/firefox-html-editor.html) which uses TinyMCE chokes on the bulleted lists, indicating custom logic in the original converter.

---

<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: [December 24, 2017, 9:11am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/15 "2017-12-24T09:11:50Z")

</div>

Good catch! They also using `<![if !supportLists]>` for `ul` and `ol` tags.

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/66):
>
> It would definitely be a big plus to get Word working… Word and Docs are the two most popular word processors in the world…

AFAIK both are working fine except inline formatting in Google Docs and `ol` `ul` tags in Microsoft Word. At least we don’t any regressions here. We already fallback to plain text paste in problematic situations.

Both needs some application specific workarounds which I will do after fixing all bugs in the current version.

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/66):
>
> Check out HTML EDITOR.in: Free Online WYSIWYG HTML and HTML5 Editor which seems to have it working

It is not converting at all. Since it supports HTML it’s just displaying what it receive. If you look at the source then you can understand.

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [December 24, 2017, 9:31am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/16 "2017-12-24T09:31:39Z")

</div>

> [@HTML/RTF pasting](https://meta.discourse.org/t/html-rtf-pasting/55913/67):
>
> It is not converting at all. Since it supports HTML it’s just displaying what it receive. If you look at the source then you can understand.

Oh! And I thought it’d be a simple matter of copy-and-paste here… 😅

---

<div class="post-metadata">

### Author: ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/381157_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)
#### Post date: [December 24, 2017, 10:51am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/17 "2017-12-24T10:51:07Z")

</div>

Hello friends,  
I’ve noticed some strange behaviour with pasting pdf content. It seems the markdown formating commands are missing, but I’ve no clue why, the pasted text is shown with headings.

> **Adobe Acrobat Pro: Copy**
>
> ![33](https://global.discourse-cdn.com/meta/original/3X/9/0/90f9cf5745fef58000e924a463b56b45ee979c15.png)

> **Discourse result: Paste**
>
> ![16](https://global.discourse-cdn.com/meta/original/3X/a/1/a1ddec4760ed71fb2cc1155d9ccdf6d13d99adaf.png)

**UPDATE:**  
Ahhh okay, I understood: It seems the dot (•) under the text is responsible.

---

<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: [December 24, 2017, 11:26am UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/18 "2017-12-24T11:26:57Z")

</div>

This is plain text paste only. Because markdown lists will have `*` instead of dots. I am not sure about PDF files whether it have HTML copy support or not. I will 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: [January 10, 2018, 12:10pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/21 "2018-01-10T12:10:37Z")

</div>



---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [January 12, 2018, 5:33pm UTC](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661/22 "2018-01-12T17:33:58Z")

</div>

Unsure if this is within scope but links from Google Sheets aren’t converted. They look like this, as formulas.

```plaintext
=HYPERLINK("https://example.com","My example site")

```

[Next page](https://meta.discourse.org/t/help-us-to-test-the-html-pasting/77661.md?page=2)
