Skip to content

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

Closed

Description

@petdance

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.

Activity

  1. geoffmcl commented on Nov 21, 2018

    @geoffmcl
    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...

  2. petdance commented on Nov 21, 2018

    @petdance
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions