Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda