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

--css-prefix option no longer adds a hyphen to its built classes #777

Closed
petdance opened this issue Nov 21, 2018 · 2 comments
Closed

--css-prefix option no longer adds a hyphen to its built classes #777

petdance opened this issue Nov 21, 2018 · 2 comments

Comments

@petdance
Copy link
Contributor

Given this file:

<h1>example</h1>
Here's some <font color="#0000FF">blue</font>
And here's some <font color="RED">red<font>
<p></P>

The behavior of assigning classes in 5.7.17 is not the same as in 5.6.0. I don't know if this is a bug or intentional.

Under 5.6.0:

$ tidy --version
HTML Tidy for Linux version 5.6.0
$ tidy -q --css-prefix foo --clean 1  foo.html 2>&1 | grep span
 span.foo-2 {color: red}
 span.foo-1 {color: #0000FF}
Here's some <span class="foo-1">blue</span> And here's some
<span class="foo-2">red </span>

Under 5.7.17:

$ tidy --version
HTML Tidy for Linux version 5.7.17
$ tidy -q --css-prefix foo --clean 1  foo.html 2>&1 | grep span
 span.foo2 {color: red}
 span.foo1 {color: #0000FF}
Here's some <span class="foo1">blue</span> And here's some
<span class="foo2">red </span>

So now it makes "foo1" instead of "foo-1" as a class name. Is that intentional? When did it get changed? This affects one of my tests in HTML::Tidy5, which pass under 5.6.0 and no longer pass under 5.7.17.

@geoffmcl
Copy link
Contributor

@petdance it is intentional I guess... it got change in #679, part of commit ea4ae0d, where I wrote -

In summary, as far as I can tell the removal of the auto addition of a - character is cosmetic only. 
If a user really wants it back then they can add it to the css-prefix "d-" option...

If it is in a test, then I guess the results must be adjusted according to the version, or the difference accounted for in some other way... sorry...

@petdance
Copy link
Contributor Author

I'm not complaining, and I know how to fix my tests. I just wanted to bring it to your attention because I couldn't tell if it was an intentional, since I don't have a list of changes between 5.6.0 and now, and I didn't see any GH issues when searching for "css-prefix".

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

2 participants