Added test cases to this PR.

This commit is contained in:
Jim Derry 2021-06-30 09:25:37 -04:00
parent 64784e2582
commit 65aa1bdd8c
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<!--
This test case represents HTML Tidy issue #692, which describes
how Tidy misbehaves when there are multiple <title> elements present.
The reason this change is needed is to alert the user that multiple
<title> elements are present, and to deleted all but the first title
element, which is consistent with the behavior of mainline web browers
as of this commit date.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HEAD>
<TITLE>Test stuff</TITLE>
<TITLE>As if one title isn't enough</TITLE>
</HEAD>
<BODY>
<P>This is my paragraph</P>
</BODY>
</HTML>

View File

@ -0,0 +1,18 @@
<!--
This test case represents HTML Tidy issue #692, which describes
how Tidy misbehaves when there are multiple <title> elements present.
The reason this change is needed is to alert the user that multiple
<title> elements are present, and to deleted all but the first title
element, which is consistent with the behavior of mainline web browers
as of this commit date.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test stuff</title>
</head>
<body>
<p>This is my paragraph</p>
</body>
</html>

View File

@ -0,0 +1,17 @@
line 10 column 5 - Warning: too many title elements in <head>
line 10 column 5 - Info: <head> previously mentioned
line 12 column 9 - Warning: discarding unexpected <title>
Info: Doctype given is "-//W3C//DTD XHTML 1.0 Transitional//EN"
Info: Document content looks like XHTML 1.0 Strict
Tidy found 2 warnings and 0 errors!
About HTML Tidy: https://github.com/htacg/tidy-html5
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
Validate your HTML documents: http://validator.w3.org/nu/
Lobby your company to join the W3C: http://www.w3.org/Consortium
Do you speak a language other than English, or a different variant of
English? Consider helping us to localize HTML Tidy. For details please see
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md