Skip to content

tidy creates non-tidy empty <title> tag #1122

Open
@petdance

Description

@petdance

Tidy creates a <title> tag when one is missing, but it's empty and that's not tidy.

$ cat bad.html
<a href="http://www.example.com/"><em>This is a test.
$ tidy -o good.html -f errors.txt bad.html
$ cat good.html
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Apple macOS version 5.8.0">
<title></title>
</head>
<body>
<a href="http://www.example.com/"><em>This is a test.</em></a>
</body>
</html>
$ tidy -e -q good.html
line 6 column 1 - Warning: blank 'title' element

I discovered this because I am updating the HTML::Tidy5 Perl module and one of the automated tests I have is that the cleaned HTML that comes back is itself clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions