Created
February 26, 2010 06:33
-
-
Save chaupt/315480 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This fails with Nokogiri 1.4.1 (tested so far on Mac OS X 10.6.2 and EngineYard Cloud instances (custom GenToo?) | |
| # The outer div gets stripped. | |
| it "should handle html comments without removing outer divs" do | |
| s = %|<!-- Some Comment --> | |
| <div> | |
| <div></div> | |
| </div> | |
| <!-- Another Comment -->| | |
| fragment = Nokogiri::HTML.fragment(s) | |
| fragment.to_s.should == s | |
| end | |
| # Results in: | |
| # | |
| # should handle html comments without removing outer divs | |
| # expected: "<!-- Some Comment -->\n<div>\n<div></div>\n</div>\n<!-- Another Comment -->", | |
| # got: "<!-- Some Comment -->\n<div></div>\n\n<!-- Another Comment -->" (using ==) | |
| # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment