-
-
Notifications
You must be signed in to change notification settings - Fork 903
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
<br /> preceded by a newline is lost when parsing an HTML fragment #178
Comments
This also applies to other HTML -- I have observed it with anchors, i.e., "One line\nTwo line\n\n<a href="http://brokenlink.com">This won't be a link after parsing</a>" However, if I wrap the text block in a <div> and </div>, it works. I'm thinking that the newline must somehow interfere with Nokogiri's ability to discern the insides as HTML. |
OK, will investigate. |
fixing leading text node with newline in fragment parsing. closed by b659302. |
Great turnaround time, thanks a lot! Between this and the fix to the document.root.namespace exception you recently did, I'd love to see a gem bump soon so I can strip out my collection of kluge-fixes. :) |
Should be bumped this weekend. Cross your fingers. |
When a
<br />
element is preceded by a newline in an HTML fragment, Nokogiri seems to remove it when the fragment is parsed. Here's an irb session demonstrating the issue (using Nokogiri 1.4.0 with libxml2 2.7.6):If I remove the newline, the fragment is parsed just fine:
The text was updated successfully, but these errors were encountered: