GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.95k stars 395 forks source link

Question: View raw HTML #477

Closed bananenklops closed 6 years ago

bananenklops commented 6 years ago

Is there a way or a workaround to toggle between raw and formatted HTML for the whole editable area like you can in the CKEditor?

etal2 commented 6 years ago

There is no built-in support for raw html editing. Personally I added a tool which opens a dialog and integrated codemirror for html editing. It's part of a larger commercial project but I can separate out the relevant code if you want to use it.

anthonyjb commented 6 years ago

@bananenklops - @etal2 is correct, the editor doesn't provide an editor for the HTML it generates.

You can change the HTML within some elements you edit (such as li, p, pre, td) using the tag bar (bottom left) and the code tab in the properties box.

bananenklops commented 6 years ago

@etal2 thank you for your reply. I would like to view the code of your solution.

etal2 commented 6 years ago

Code uploaded to https://github.com/etal2/ContentTools-Codemirror

ShalomR commented 6 years ago

This sounds handy! Could I see a screen shot of how this looks in action by any chance? :D

etal2 commented 6 years ago

Added screenshot although it's just a text editor in a dialog box nothing fancy.