Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidying incomplete <li> tag without <ul> returns unexpected html #725

Open
k-kyuno opened this issue Apr 23, 2018 · 1 comment
Open

Tidying incomplete <li> tag without <ul> returns unexpected html #725

k-kyuno opened this issue Apr 23, 2018 · 1 comment
Labels
Milestone

Comments

@k-kyuno
Copy link

k-kyuno commented Apr 23, 2018

Hello.
I cleaned up the following html with tidy 5.6.0.

/work/html # cat missing_list_tag.html
<!DOCTYPE html>
<html>
<head>
<title>missing list tags</title>
</head>
<body>
<li>1st list item
<li>2nd list item
</body>
</html>

Then returned

/work/html # tidy --indent y -q missing_list_tag.html
line 8 column 1 - Warning: inserting implicit <ul>
line 8 column 1 - Warning: missing </ul>
<!DOCTYPE html>
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for HTML5 for Linux version 5.6.0">
    <title>
      missing list tags
    </title>
  </head>
  <body>
    <li>1st list item
      <ul>
        <li>2nd list item
        </li>
      </ul>
    </li>
  </body>
</html>

I expected the following results, but the html obtained seems to be incorrect; It has changed semantically.
(Note: In tidy 5.2.0 returns the expected result. Attaching the doctype of html 4 in tidy 5.6.0 also returns the expected result.)

<!DOCTYPE html>
<html>
<head>
<title>missing list tags</title>
</head>
<body>
<ul>
<li>1st list item</li>
<li>2nd list item</li>
</ul>
</body>
</html>

I think that this is related to #525, but since <ul> is inserted, it seems like another problem.
And this issue also seems to be related:
#396 (This behavior was introduced?)
#572

Thanks

@geoffmcl
Copy link
Contributor

@k-kyuno thank you for the issue...

Yes, it seems this is a BBB - Big Bad Bug - introduced sometime after the release of 5.2, and only manifests itself in HTM5 documents... UGH!

And thanks for the related links #525, #396, #572, and maybe #428 and others...

Still researching, and tracking this down... feedback, patches, PR very welcome... thanks...

@geoffmcl geoffmcl added the Bug label Apr 24, 2018
@geoffmcl geoffmcl added this to the 5.7 milestone Apr 24, 2018
@balthisar balthisar modified the milestones: 5.7, 5.9 Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants