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

better_html scans any project that uses i18n-tasks #422

Closed
eligordon opened this issue Mar 23, 2022 · 7 comments · Fixed by #423
Closed

better_html scans any project that uses i18n-tasks #422

eligordon opened this issue Mar 23, 2022 · 7 comments · Fixed by #423

Comments

@eligordon
Copy link

With v1.0.0 of i18n-tasks included in my project, better_html is now scanning (and occasionally criticizing the HTML markup of) the files in my project and any other gems that I use on render. I doubt this is the effect you wanted. Perhaps you only need to require 'better_html/parser'?

(@davidwessman)

davidwessman added a commit to davidwessman/i18n-tasks that referenced this issue Mar 23, 2022
- Only require better_html/errors and better_html/parser.
- Fixes glebm#422
@davidwessman
Copy link
Collaborator

@eligordon Can you elaborate on how to reproduce it?
Please include:

  • What you define in your Gemfile (do you use better_html already?)
  • What command you are running?

I did a pr on #423 that might fix it.

@jsantos
Copy link

jsantos commented Mar 24, 2022

Bumped into this after upgrading to 1.0.0. I didn't used better_html before the upgrade, so now it breaks the dev environment (at least) just because of some double quotes are used to define conditional classes.

I wasn't running any specific command, just a usual rails s while running the project locally.

Will rollback until #423 is merged :) Thanks for all your work!

Btw, this was the "offensive" html:

 <div class="form-group <% if @user_session.errors[:username].present? %>has-error<% end %>">

@davidwessman
Copy link
Collaborator

How do you use i18n-tasks? Are you importing it to create a test / spec?
I cannot reproduce it on locally :/

glebm pushed a commit that referenced this issue Mar 24, 2022
- Only require better_html/errors and better_html/parser.
- Fixes #422
@pavel-workpath
Copy link

We are having a similar issue in our specs on 1.0.0

We basically use a copy of the template spec, and it seems that after that every template we render during testing get validated by better_html. Which is unexpected

Thanks for checking it and looking forward to that 1.0.1!

@glebm
Copy link
Owner

glebm commented Mar 24, 2022

I released 1.0.1 a few minutes ago!

@davidwessman
Copy link
Collaborator

We are having a similar issue in our specs on 1.0.0

We basically use a copy of the template spec, and it seems that after that every template we render during testing get validated by better_html. Which is unexpected

Thanks for checking it and looking forward to that 1.0.1!

Ah, I will see if I can write a spec for this. Can you try 1.0.1?

@pavel-workpath
Copy link

Thanks guys! The 1.0.1 looks fine, both specs and tasks work as they did before the update

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

Successfully merging a pull request may close this issue.

5 participants