Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
disabling TinyMCE auto-formatting content behavior

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?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!