Delete values after switching from visual to text mode
-
Hi. I have a problem with this editor. I added some custom buttons to the visual editor. They are to generate a table or its rows depending on a clicked button.
tinymce.PluginManager.add("table", function (editor, url) { editor.addButton("table", { text: "Table", image: "table.svg", onclick: function () { editor.insertContent('<table class="match"><thead><tr class="head">(...)</thead><tbody><tr class="date-style" onclick="this.classList.toggle(<code>expanded</code>)"><td class="date" colspan="5"><div class="head-date">(..)<div class="more">More...<span class="glyphicon glyphicon-info-sign"style="margin-left: 5px"></span></div> (...) }, }); });
After generating this table, I don’t know if these two lines are generated in the visual editor:
1)onclick="this.classList.toggle("expanded")"
<- expended is in single quote
2)<span class="glyphicon glyphicon-info-sign"style="margin-left: 5px">
But after switching to a text editor, they are not there.
Sometimes it only changes in the span tag from
<span class=... >
to& lt ;spanclass=... & gt ;
How to fix it?
- The topic ‘Delete values after switching from visual to text mode’ is closed to new replies.