Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

172
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda