I personally tend to hate WYSIWYG editors. They take time to load and just love plain old HTML, so I just disable the editor entirely. However, I would like to have HTML from the database to be prettyfied or beautified or ... well, loooking sexy for the time of editing with indents, newlines, etc. Any module out there that does that?


There's a patch here to provide support for Ace code editor in wysiwyg module.

From Ace's website:

Ace is an embeddable code editor written in JavaScript. It matches the features and performance of native editors such as Sublime, Vim and TextMate. It can be easily embedded in any web page and JavaScript application. Ace is maintained as the primary editor for Cloud9 IDE and is the successor of the Mozilla Skywriter (Bespin) project.

I'm not aware of any other source code wysiwyg editor supported by wysiwyg.module.


You're looking for HTML Tidy module.

This module tidies Drupal's HTML output with HTML Tidy by optionally sanitizing it when it is saved or when it is displayed, like a traditional input formatter. Missing and mis-ordered tag components are replaced and reordered automatically so that user input doesn't break site structure with open tags and the like.

User interface configuration supports:

Code indenting: Automatically format HTML for easier reading, or strip indenting for proper parsing and display in the less compliant browsers. Word wrapping: Automatically wrap lines in an intelligent fashion once they get to a specified length Info/Warning/Error information: Optionally appended to pages and includes details about the wrong HTML attributes and W3C validation info.

  • Correct me if I got it wrong. HTML Tidy tidies up the Drupal's output and the edited HTML chunk for a particular node is not "output" and is therefore not formatter/indented. I am looking more into something similar to markitup - a tool for the HTML editing. Sep 13 '13 at 23:26
  • You need to create a text format and then you can use it on fields Sep 13 '13 at 23:33
  • Somehow this does not work. dropbox.com/s/uezp2j87t1asfhd/… Sep 14 '13 at 17:19
  • Your text format is showing Full HTML in your screenshot. You need to create an HTML Tidy text format and use that. Sep 14 '13 at 18:01
  • It works now and I played the settings for some time, however, the indenting and word wrapping is not as I expected, it simply wraps at a certain position. I expected unnecessary spaces to be stripped and the HTML code reformatted with nested tags taken into account, etc. Sep 18 '13 at 5:45

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.