{"action":"created","issue":{"url":"https://api.github.com/repos/jhy/jsoup/issues/205","labels_url":"https://api.github.com/repos/jhy/jsoup/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/jhy/jsoup/issues/205/comments","events_url":"https://api.github.com/repos/jhy/jsoup/issues/205/events","html_url":"https://github.com/jhy/jsoup/issues/205","id":4898591,"number":205,"title":"Node is its own parent causes Element.preserveWhitespace() to loop forever","user":{"login":"swenson","id":33404,"avatar_url":"https://avatars.githubusercontent.com/u/33404?v=3","gravatar_id":"","url":"https://api.github.com/users/swenson","html_url":"https://github.com/swenson","followers_url":"https://api.github.com/users/swenson/followers","following_url":"https://api.github.com/users/swenson/following{/other_user}","gists_url":"https://api.github.com/users/swenson/gists{/gist_id}","starred_url":"https://api.github.com/users/swenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swenson/subscriptions","organizations_url":"https://api.github.com/users/swenson/orgs","repos_url":"https://api.github.com/users/swenson/repos","events_url":"https://api.github.com/users/swenson/events{/privacy}","received_events_url":"https://api.github.com/users/swenson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2012-06-04T22:35:07Z","updated_at":"2015-08-31T02:28:27Z","closed_at":"2015-08-31T02:28:27Z","body":"When parsing certain HTML documents, Element.preserveWhitespace() seems to go into an infinite loop. This appears to be caused by the Element having itself as parentNode.\n\nI am still trying to come up with HTML that causes this to happen (unfortunately, I have lost the original problematic HTML), and I am not familiar enough with the parser to debug it at this time."},"comment":{"url":"https://api.github.com/repos/jhy/jsoup/issues/comments/136236419","html_url":"https://github.com/jhy/jsoup/issues/205#issuecomment-136236419","issue_url":"https://api.github.com/repos/jhy/jsoup/issues/205","id":136236419,"user":{"login":"jhy","id":76934,"avatar_url":"https://avatars.githubusercontent.com/u/76934?v=3","gravatar_id":"","url":"https://api.github.com/users/jhy","html_url":"https://github.com/jhy","followers_url":"https://api.github.com/users/jhy/followers","following_url":"https://api.github.com/users/jhy/following{/other_user}","gists_url":"https://api.github.com/users/jhy/gists{/gist_id}","starred_url":"https://api.github.com/users/jhy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhy/subscriptions","organizations_url":"https://api.github.com/users/jhy/orgs","repos_url":"https://api.github.com/users/jhy/repos","events_url":"https://api.github.com/users/jhy/events{/privacy}","received_events_url":"https://api.github.com/users/jhy/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T02:28:27Z","updated_at":"2015-08-31T02:28:27Z","body":"So even with a very low stack (-Xss4m), that page doesn't cause a stack overflow. It took about 10sec to parse, but didn't have any issues. We did change some of the parse to use a traversor vs a recurse, so potentially that fixed the stack overflow.\r\n\r\nBut that's not related to the original bug anyway, which is a complaint about getting a child can't be own parent error.\r\n\r\nGiven the age of the bug and no data to repro, I'm going to close. Please re-open if you can get a test case that produces the original error. (Or a different bug if you can get a stack overflow.)"}}