Skip to content

Tidy deletes empty tags #669

@ghost

Description

When running tidy with html containing empty tags, many empty tags are simply removed. For example i, span and li elements. This is a problem as many of these elements are in fact significant, as can be seen in my example.

My version string: "HTML Tidy for Linux version 5.4.0"

A minimal, verifiable example:

<!doctype html>
<html lang="en">
  <head>
    <link href="vendors/css/ionicons.min.css" rel="stylesheet"/>
  </head>
  <body>
    <span class="ion-bug"></span>
  </body>
</html>
$  cat test.html | tidy > test1.html

produces

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.4.0">
<link href="vendors/css/ionicons.min.css" rel="stylesheet">
<title></title>
</head>
<body>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions