Is there some way to have HTML code (color code) view for editors, when using a plain editor (no WYSIWYG )?
I write the HTML myself, it would be nice when it looks better formatted.

Comments

Jaypan’s picture

Is there some way to have HTML code (color code) view for editors, when using a plain editor (no WYSIWYG )?

No. Text in a textarea cannot be formatted.

Although I guess you could create your own contenteditable element, and apply the formatting using that.

bhaskar-chakraborty’s picture

Could you please guide how to use this  contenteditable element in a drupal site.I do not find anything on that.

Jaypan’s picture

Unfortunately, it's not something that can be explained in a forum post. There are too many small details. The best I can give you the overview of how it will work, but you'll need to spend some time learning how to code in Drupal to be able to accomplish it:

1) You'll have to add a textarea that will hold the actual text. This will need to be hidden with CSS.

2) Create a div with contenteditable set to TRUE. Add some JavaScript that copies the value of this div to the hidden textarea on keyup.

3) Apply your geshi filter to the contenteditable div with the JS, on content up.

bhaskar-chakraborty’s picture

Ok let me try once and let you know.

allie.rockdev@gmail.com’s picture

Jaypan’s picture

Nice, that looks pretty good!

bhaskar-chakraborty’s picture

yes it will be helpful.

Autosme’s picture

That module seems to do the job, will be trying it later. Thanks.

Autosme’s picture

Tested the Ace module, works perfect. One disadvantage though is that it cannot be manually resized, and it removed the resize handle from my other CKEditor format... now why would it do that..

allie.rockdev@gmail.com’s picture

Yes, the no manual resize thing is quite annoying. I've never had it mess with CKEditor resize handles, even with multiple instances of both on a single /admin page.