Skip to content

Conversation

@Noah-Silvera
Copy link
Contributor

@Noah-Silvera Noah-Silvera commented Feb 13, 2025

What are you trying to accomplish?

In view components rendered for test, we should allow opt-in Nokogiri::HTML5 parsing

Nokogiri::HTML is just an alias for Nokogiri::HTML4, so this is a non-breaking change.

I was motivated to make this change because in my own app, Nokogiri::HTML4 was parsing my rendered HTML incorrectly (inserting spaces in the middle of data attributes), while Nokogiri::HTML5 parsed it correctly.

Example of the incorrect parsing

Screenshot 2025-02-13 at 10 43 37 AM
Screenshot 2025-02-12 at 5 27 44 PM

@Noah-Silvera Noah-Silvera force-pushed the main branch 3 times, most recently from 8b14c8d to d3e4c53 Compare February 13, 2025 15:48
In view components rendered for test, we should allow opt-in Nokogiri::HTML5 parsing

Nokogiri::HTML is just an alias for Nokogiri::HTML4, so this is a non-breaking change.
@joelhawksley
Copy link
Member

@Noah-Silvera thank you for your PR! I opted to just make this change the default in v4, which we should release in the next couple of months ❤️ #2218

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 this pull request may close these issues.

2 participants