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

pphtml no longer finds .br when unused #1240

Closed
btaylor289 opened this issue Aug 26, 2023 · 6 comments · Fixed by #1242
Closed

pphtml no longer finds .br when unused #1240

btaylor289 opened this issue Aug 26, 2023 · 6 comments · Fixed by #1242
Labels
bug Something isn't working

Comments

@btaylor289
Copy link

Running version 1.6.0 of Guiguts.

I click on HTML/PPhtml and view the report of "CSS possibly not used:" br no longer shows up even when unused. I have
run across this three times now after upgrading to the latest version of Guiguts.

The CSS code in my html file is: .br {border-right: 2px solid;}

The online version of PPhtml does list br as defined but not used

I've attached a screenshot of both the online and Guiguts outputs showing the difference.
Thanks
Bob

PPhtml

@btaylor289 btaylor289 added the bug Something isn't working label Aug 26, 2023
@windymilla
Copy link
Collaborator

windymilla commented Aug 27, 2023

The explanation is that br is the name of an HTML element. While this is legal to also use a CSS class name, the changes to the code in pphtml (to avoid previous false positives) stores the elements and class names used in the same structure. Therefore since your file contains the element <br>, pphtml mistakenly counts that as using class="br".
I'll have a look at the code to see if it can be rewritten to properly distinguish between elements and class names.

@windymilla
Copy link
Collaborator

@btaylor289 - please could you copy this version of pphtml into your lib/ppvchecks folder under your Guiguts release, and see if it works as you expect. Thanks

@btaylor289
Copy link
Author

Hi Nigel,

Yes, this updated pphtml did find the unused .br in my CSS. One change is the entire list is in reversed order from what I'm used to. I'm not complaining - I like it in this order.

Thanks
Bob

@windymilla
Copy link
Collaborator

Oh yes, forgot to mention that I decided to reverse the list while I was fixing the bug

@windymilla windymilla linked a pull request Aug 28, 2023 that will close this issue
@windymilla
Copy link
Collaborator

Updated version in case you want it, @btaylor289. Previous version gave spurious report about x-ebookmaker classes.

@btaylor289
Copy link
Author

btaylor289 commented Aug 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants