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

217
Views
How to remove all attributes and classes from HTML with tidy?

I have a lot of HTML files such as:

<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">some text</P>
<TABLE class=MsoNormalTable style="BORDER-RIGHT: windowtext 1pt solid;" cellSpacing=0 cellPadding=0 width=568 border=1>
<TR style="HEIGHT: 12.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="BORDER-RIGHT: windowtext 1pt solid;" width=357 colSpan=2>text td</TD>
</TR>
</TABLE>

I need to remove all attributes and classes from it, so I get:

<P>some text</P>
<TABLE>
<TR>
<TD>text td</TD>
</TR>
</TABLE>

I've tried tidy utility with different options (drop-proprietary-attributes, word-2000) but can't get clean code.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This remove all MS styles:

tidy --word-2000 true --bare true -o output.html input.htm 

I use "HTML Tidy for Linux version 5.1.25"

over 4 years ago · Santiago Trujillo 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!