`white-space` CSS property of clipboard data not respected when pasting in rich text editor

Thanks so much for the fix @renato, and for taking the time to post an update here!

The recent bug fixes have brought the rich text editor’s functionality to the point where it can serve to make our forum more approachable to less technical users who aren’t already familiar with Markdown and not motivated to learn it.


There still are a couple of conditions under which the results are not expected, but these are things that are not reasonable to mitigate via the Discourse codebase:

Corruption due to incidental markup syntax

Posts may be corrupted in the case where there is content that incidentally resembles markup. This is due to the intentional decision to support markup in the rich text editor.

For our use case where those who wish to use markup are expected to use the Markdown editor, while the rich text editor is intended only for use by those with no interest in using markup, this is a very unfortunate decision. One of the most significant problems we have with non-technical users using the Markdown editor is post corruption due to incidental markup and I had great hopes that the rich text editor would provide a solution for that. However, for the use case where a forum will only provide a rich text editor, this design makes perfect sense as it still allows users fluent in Markdown to efficiently compose posts.

Incorrect formatting due to inappropriate markup in clipboard content

We have a case where the “text/html” type content added to the clipboard when copying from a specific application has inappropriate HTML markup, which results in incorrect formatting when the content is pasted into the rich text editor outside a code block.

This is of course a bug in the application and Discourse is acting 100% correctly by formatting the content as indicated by the markup.

1 Like