I am using tinyMCE with angularjs for editing and saving html content. whenever I do even small change tinyMCE formats my content, remove spaces etc. i want to disable this but not found the way.have tried many settings changes but content still getting format. for example src content is:
<body>
<table>
<tbody>
<tr>
<td align="left" style="width:75%">
<margin>
<p class="">user</p><p class="">®</p><p class=""> aaa:</p>
<ul>
<li><p class="">bla bla® on bla bla</p></li>
</ul>
<p class="">Details @ <a href="">bla bla</a></p>
</margin>
</td>
<td align="right" valign="top" style="width:25%">
</td>
</tr>
</tbody>
</table>
</body>
</html>
after changing via tinymce:
<html>
<body>
<table>
<tbody>
<tr>
<td style="width: 75%;" align="left">
<p class="">user</p>
<p class="">®</p>
<p class="">aaa:</p>
<ul>
<li>
<p class="">bla bla® on bla bla</p>
</li>
</ul>
<p class="">Details @ <a href="">bla bla</a></p>
</td>
<td style="width: 25%;" align="right" valign="top"> </td>
</tr>
</tbody>
</table>
</body>
</html>
any idea how this behavior of autoformatting can be stopped?
solved it with hakish solution ( no tinyMCE documentation for it anywhere) adding below settings inside tinymce.init({... solve the issues for me:
indent_before: 'h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
'tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
indent_after: 'h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' +
'tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
whitespace_elements: 'p pre script noscript style textarea video audio iframe object code',
indent_before, indent_after - I removed the p element from that list and left all the default I have found in tinymce.js source file. this stopped putting space before and after each p. whitespace_elements - I added the p element to that list and left all the default I have found in tinymce.js source file. this stopped removing trainling spaces in the begining of P element