craftcms / redactor

Edit rich text content in Craft CMS using Redactor by Imperavi.
https://plugins.craftcms.com/redactor
MIT License
100 stars 48 forks source link

non-breaking spaces ( ) are removed when pasting text with those spaces #383

Closed taya13 closed 2 years ago

taya13 commented 2 years ago

Description

When I paste text which contains non-breaking spaces, they get replaces with normal spaces. I tried all kind of configurations but nothing seems to have effect on it. I can not switch it off (if its possible). Theoretically, checkbox with field configuration:

Steps to reproduce

  1. type text in word/gogole docs with non-breaking space (you can type on keyboard: ALT+0160)
  2. copy/paste in redactor, then check source code. It will be spaces instead of  

Additional info

All installed Plugins: Asset Metadata 3.0.0 Cache Warmer 1.0.3 Colour Swatches 1.5.1 Control Panel Nav 3.0.17 Element API 2.8.4 Entries Subset 1.2.3 Feed Me 4.4.2 Google Cloud Storage 1.4.1 Inlin 2.1.1 LJ Dynamic Fields 3.0.12 Minify 1.2.11 Neo 2.13.1 Reasons 2.2.6 Redactor 2.10.5 Retour 3.1.70 Schedule 0.2.2 SEO 3.4.27 Sherlock 3.1.4 Sidebar Themes 1.1.0 SimpleMap 3.3.5 Super Table 2.7.1 Twigpack 1.2.15 Update Checker 1.3.0

brandonkelly commented 2 years ago

You can control this behavior from your field settings. Expand “Advanced” and untick “Replace non-breaking spaces with regular spaces”.

A screenshot of some of Redactor’s advanced field settings, with “Replace non-breaking spaces with regular spaces” highlihted
taya13 commented 2 years ago

No, I am not talking to replace when saving. I am talking when editing - and copy/paste text from somewhere else to redactor field, it removed on the fly (when field is saved - its another thing). JavaScript is removing non-breaking spaces while editing the redactor text area. Some things are configurable in redactor config in json files. but not this one.

This issue is not fixed, could you please reopen it

taya13 commented 2 years ago

https://www.loom.com/share/9820e53793204919b65e512fcea47ddb

I recorded demonstration of the issue...

By the way, redactorX doesnt do this (it doesnt remove   when pasting it ) - https://imperavi.com/redactorx/ but redactor does. https://imperavi.com/redactor/