I am using the Kendo UI angular editor and need to save both the markup and the plain text from inside the control. I would like to keep the markup text encoded. This editor is being used within a custom template for a Kendo UI Grid popup edit. From what I have researched, I see two possible options to handle this.
- Write code to programmatically call the cleanFormatting toolbar method, save the original copy of the text, create a range of the body of the editor, select this range, call the cleanFormatting method, and save the new copy of the text.
- Programmatically replace all markup in the original copy of the text using some jQuery approach.
I would think that the first option would be the cleanest since it would be using Kendo throughout. However, the original copy of the text is encoded and calling the cleanFormatting method does not seem to call the exec method listed in the tools array for the editor. Furthermore, all HTML tags are still present. This is what I have so far for my tools and for the create method for my grid:
When I use the button on the editor itself, I get exactly what I want. Is there a way to handle this programmatically, or is that not possible?
Because of the encoding, getting a jQuery method to strip the tags does not seem to work either. I have tried a few approaches, including
That seems to keep all the HTML tags that are inside the string, though.
Is there some way to do this with Kendo editor? Thanks for all your help!