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

343
Views
TinyMCE wont strip ALL inline-styles (all attributes) and empty tags

No matter what I do, what docs I read, what custom scripts I try, I cannot get TinyMCE to remove ALL inline styles and delete empty tags.

  1. If you CTRL+A the text from this Google Doc
  2. And paste it into this Codepen
  3. And then click the "Code" button on TinyMCE, you'll always have this stuff

<h1>&nbsp;</h1>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Lorem Ipsum</span></li>
<p>&nbsp;</p>

I want it to do what html-cleaner.com does upon paste, which leaves you with perfectly clean HTML. If you copy the TinyMCE html result into that site, you'll get this result:

<h1><strong>Title</strong></h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<h3><strong>Lorem Ipsum is simply dummy text</strong></h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.&nbsp;</p>
<ul>
<li>Lorem Ipsum is simply dummy tex</li>
<li>he industry's standard dummy text ever since the 1500s</li>
<li>when an unknown printer took&nbsp;</li>
</ul>
<p>Tt to make a type specimen book. It has survived not only five centuries, but also the leap into ele</p>
<h3><strong>Simply dummy text of the&nbsp;</strong></h3>
<p>Readable English. Many desktop publishing packages</p>
<ul>
<li>Lorem</li>
<li>Ipsum</li>
</ul>

What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
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!