Skip to content

Is there any way to remove inline styles? #689

Description

@i-give-up

[Feature request] One workaround is to use --clean yes and then remove the <style> tag manually. But a built-in way for tidy to remove inline styles would be quicker and would result in a smaller file size.

Use case: when exporting a spreadsheet as HTML, the program tries to preserve the original appearance using a lot of style information resulting in an odd-looking HTML table.

Input

<!DOCTYPE html>
<html>
  <title>Testing</title>
<body>
<table>
  <tr>
    <td style="font-weight:bold">Hello whirl!</td>
    <td style="color:red">Goodbye!</td>
  </tr>
</table>
</body>
</html>

Desired output

<!DOCTYPE html>
<html>
  <title>Testing</title>
<body>
<table>
  <tr>
    <td>Hello whirl!</td>
    <td>Goodbye!</td>
  </tr>
</table>
</body>
</html>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions