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

Tidy catches repeated attributes, but misses identical ids #924

Closed
jidanni opened this issue Mar 11, 2021 · 6 comments
Closed

Tidy catches repeated attributes, but misses identical ids #924

jidanni opened this issue Mar 11, 2021 · 6 comments

Comments

@jidanni
Copy link
Contributor

jidanni commented Mar 11, 2021

Tidy catches repeated attributes, but misses identical ids!

$ cat eee.htm
<!DOCTYPE html>
<html>
<head>
 <title>TEST</title>
</head>
<body>
 <p id="A" id="X">aaa</p>
 <p id="B">bbb</p>
 <p id="B">ccc</p>
</body>
</html>
$ tidy -q eee.htm
line 7 column 2 - Warning: <p> dropping value "A" for repeated attribute "id"
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.6.0">
<title>TEST</title>
</head>
<body>
<p id="X">aaa</p>
<p id="B">bbb</p>
<p id="B">ccc</p>
</body>
</html>

Not even a warning is produced.

@ler762
Copy link
Contributor

ler762 commented Mar 11, 2021

It would be nice if there was a new release of tidy[1]; you do get a warning with a current-enough version of tidy. But until there is a new release, you're stuck with using the old 5.6.0 with what I consider too many known issues or using the maybe not "release quality" tidy from git.

$ cat x.html
<!DOCTYPE html>
<html>
<head>
 <title>TEST</title>
</head>
<body>
 <p id="A" id="X">aaa</p>
 <p id="B">bbb</p>
 <p id="B">ccc</p>
</body>
</html>

$ tidy -q  x.html
line 7 column 2 - Warning: <p> dropping value "A" for repeated attribute "id"
line 9 column 2 - Warning: <p> anchor "B" already defined
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Cygwin version 5.7.35.next.2020.10.04">
<title>TEST</title>
</head>
<body>
<p id="X">aaa</p>
<p id="B">bbb</p>
<p id="B">ccc</p>
</body>
</html>

If you do decide to build from source, here's the script that I use. Nothing special except the -DTIDY_RC_NUMBER=next.2021.02.23 that I update every time I do a git pull so that it's easier to keep track of what code I'm running:

$ cat build-and-test.sh
#!/bin/sh

# starting from my local tidy git repository
cd tidy-html5/build/cmake

cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \
            -DBUILD_SHARED_LIB:BOOL=YES \
            -DTIDY_RC_NUMBER=next.2021.02.23

# make && make install
  make || exit

# go back up to the git <root-dir>
cd ../../..
# and down to where the regression test script lives
cd tidy-html5-tests/tools-sh
# run the test
./testall.sh ../../tidy-html5/build/cmake/tidy.exe

# and show which tests returned different results
diff -U5 ../cases/testbase-expects/ ../cases/testbase-results

Regards
Lee

[1] did tidy become a 'source code only' package?
https://github.com/htacg/tidy-html5/releases shows a 5.7.28 version that looks like it's a source code only release.

@jidanni
Copy link
Contributor Author

jidanni commented Mar 11, 2021

OK, I'll tell Debian to take your advice.

@hosiet
Copy link

hosiet commented Mar 12, 2021

Debian tidy package maintainer here. I would be very glad to introduce new version of tidy if there were a stable release of tidy. Unfortunately that's not the case. According to https://github.com/htacg/tidy-html5/releases , the latest stable release is still 5.6.0.

@geoffmcl
Copy link
Contributor

@hosiet, For what it is worth, just added v.5.7.28, as an interim stable release...

I only use interim, because I do not have the time, enthusiasm, whatever, to add the usual multiple steps, like add Release Notes, can use git log to see, add Binaries, of various flavors, give it even tag, per the stated release policy, and that would include a SO number bump, in unix... etc... etc... etc...

Really NEED some HELP here... or at least some encouragement... thanks...

@jidanni, as a solid user, and reporter, of/on tidy... which is good... you really should pull/build your own next... as @ler762 suggests... and benefit by some great fixes made since 5.6... improved stability... including an added warning <p> anchor "B" already defined, on the given sample... so this issue is fixed, I think... advise if I got it wrong... thanks...

@ler762, thanks for the script... I too, like you, use -DTIDY_RC_NUMBER=next.2021.02.23, or the like, to keep track of many versions... but really, only code devs should need to add the regression tests, every time... but its good if you do... thanks for the feedback...

@hosiet
Copy link

hosiet commented Mar 24, 2021

Thanks for the info! I will be looking at current condition of v5.7.28 and review commits after that tag.

This tidy project has always been an important component in Linux distributions and various other projects and your work is really appreciated. I'll see what I can do to help from my side.

@geoffmcl
Copy link
Contributor

@hosiet, thanks for the appreciation...

OT: As stated elsewhere, next is always kept in a release state... all development is done in branches, and tested, before merging to next... and bumping the version...

It is for that reason that we strongly promote, cloning, and building from source... a really good idea for @jidanni, and other power users, to consider this (easy) option... thus helping in the ongoing testing of tidy... win win...

And concerning a review, after the tag 5.7.28, I note that version 5.7.45 has been in testing since last Nov, 2020, so will get around to pushing another tag, and adding a latest v5.7.28, if this helps... thanks...

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

No branches or pull requests

4 participants