Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
164
rated 0 times [  165] [ 1]  / answers: 1 / hits: 67680  / 12 Years ago, fri, march 16, 2012, 12:00:00

How can I disable CKEditor to get me every time  , when i don't want them? I'm using CKEditor with jQuery adapter.



I don't want to have any   tags.


More From » jquery

 Answers
36

After some research I might shed some light on this issue - unfortunately there is no out-of-the-box solution.



In the CKEditor there are four ways a no-break space can occur (anybody know more?):




  1. Automatic filling of empty blocks. This can be disabled in the config:



    config.fillEmptyBlocks = false;

  2. Automatic insertion when pressing TAB-key. This can be disabled in the config:



    config.tabSpaces = 0;

  3. Converting double spaces to SPACE+NBSP. This is a browser behavior and will thus not be fixed by the CKEditor team. It could be fixed serverside or by a clientside javascript onunload. Maybe this php is a start:



    preg_replace('/s s/ig', ' ', $text);

  4. By copy & paste. If you paste a UTF-8 no-break space or double-spaces CKEditor will convert it automatically. The only solution I see here is doing a regex as above. config.forcePasteAsPlainText = true; doesn't help.




Summary: To get rid of all no-break spaces you need to write an additional function that cleans user input.



Comments and further suggestions are greatly appreciated! (I'm using ckeditor 3.6.4)


[#86796] Thursday, March 15, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
muhammadbrandend

Total Points: 670
Total Questions: 95
Total Answers: 97

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;