Search code examples
drupaleditorcontent-management-systemtinymcewysiwyg

how to get tinymce (in-browser "rich editor") to preserve indentation


PROBLEM: I use Drupal with a rich-editor, and the rich editor likes to clobber my text by stripping out the indentation and formatting. This would be unacceptable in a desktop editor, but people seem to tolerate this with in-browser wyswigs.

QUESTION: How do I turn this off. I've searched around and I have yet to discover the best practice way of telling the rich-editor to preserve my indentation and text formatting.


Solution

  • add this configuration to the tinymce init script

    tinymce.init({
        protect: [/[\n\f\r\t\v]/g]
    });