![]() Or maybe what I want is a way of disabling the functionality only when model changes are propagated up from input elements. Maybe we could provide a setting that lets the user decide whether external changes to the model trigger TinyMCE formatting? How to get content in TinyMCE without any HTML tags Depending on your use case, sometimes you might want to get the TinyMCE content without the HTML markup. Which would then potentially filter changes to the model which we do want to have formatted by TinyMCE. So by entering t, this whole formatting business wouldn't be triggered, but by updating the model with something more lengthy, like testing, things would work correctly. The second way around it I can think of is a lot more hacky, and would basically mean only updating the Angular model with TinyMCE's formatting if more than a few characters were changed. ( Edit: Now that I think about it, it would break copying and pasting for my application. It's potentially a breaking change, and I don't know enough about Angular UI usage to know whether that would be acceptable. (TinyMCE sets source_view if the incoming content comes from the TinyMCE source editor.)Īnd this works great for me, but would mean that updating the model by any method other than TinyMCE's source editor would fail to again update the model with TinyMCE's formatting applied. This could be accomplished by changing this: The directive supports all of the standard TinyMCE initialization options as listed here. So one solution would be avoid updating the model unless the changes are coming in from the TinyMCE source editor. The ui-tinymce directive stores the configuration options as specified in the TinyMCE documentation and expects the model value to be a html string or raw text, depending on whether raw is true (default value is false). From what I understand, onSetContent is the correct event to use and in fact possibly the only event that would get us the functionality we are after, which is that the model is updated after using TinyMCE's source editor. And this process happens with every keystroke, plus the business about the cursor you mentioned above. This would be fine (and is in fact what I want), except that we are hooking into setContent with onSetContent, and manually updating the Angular model with TinyMCE's formatted results. So Angular updates the model, TinyMCE sees the underlying textarea has changed, and does its formatting thing and renders it out to the widget. No such luck.Īnyway, so the problem I'm experiencing with onSetContent is that TinyMCE fires setContent every time Angular updates the model. I really need a disable_formatting option or whatever. It really just ignores invalid tags instead of trying to strip them out. a WYSIWYG-style editing interface for documents more constrained and structured than plain HTML. The verify_html option sounds almost like it ought to, but it doesn't. A toolkit for building rich-text editors on the web. Mostly I'm just going to puke back what I understand, as putting it in words helps me understand what I understand.įirst of all, I'm not finding a TinyMCE option that would do the trick. I haven't got this figured out quite yet, but I have a few thoughts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |