7

I am using CKeditor version 7.x-1.16 with Drupal 7.34. How can I force the text to wrap in source view of the editor. I don't want the horizontal scroll bar to appear.

I managed to do that in WYSIWYG view. Pressing the 'Enter key' in 'source view' will not solve it, since it gets overruled at the next switch between views.

See the images for differences. This is the same text as it appears when I switch between 'Source view' and 'WYSIWYG view'

This seems to be a Firefox problem, since in Google Chrome browser it is not an issue.

CKEditor Source View with Horizontal Scroll bar. The text doe not wrap.

CKEditor WYSIWYG View No Horizontal Scroll bar. The text wrap.

10

I found the solution to this: This is a Firefox browser issue only (FF version >= 36). This behavior is not affected in other major browsers (Safari, IE and Chrome). Here is the fix. Add the following code to you theme's CSS file:

.cke_source { white-space: pre-wrap !important; }

Basically, you are overwriting the 'white-space' property of the "cke_source" selector in the "editor_gecko.css" file of the CKEditor module. This file is located at: \sites\all\libraries\ckeditor\skins\moono\editor_gecko.css

References:

https://stackoverflow.com/questions/29038262/source-code-not-wrapping-in-ckeditor-on-firefox

https://www.drupal.org/node/1489340

http://dev.ckeditor.com/ticket/13031

0

You should probably use the WYSIWYG module (the latest dev version) and get CKeditor directly from their site (the 4.x version) and use the Code Mirror plugin. You'll have better luck keeping current.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.