{"action":"opened","issue":{"url":"https://api.github.com/repos/cure53/DOMPurify/issues/164","repository_url":"https://api.github.com/repos/cure53/DOMPurify","labels_url":"https://api.github.com/repos/cure53/DOMPurify/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/cure53/DOMPurify/issues/164/comments","events_url":"https://api.github.com/repos/cure53/DOMPurify/issues/164/events","html_url":"https://github.com/cure53/DOMPurify/issues/164","id":156959887,"number":164,"title":"Dangling markup signalling","user":{"login":"dnkolegov","id":6521369,"avatar_url":"https://avatars.githubusercontent.com/u/6521369?v=3","gravatar_id":"","url":"https://api.github.com/users/dnkolegov","html_url":"https://github.com/dnkolegov","followers_url":"https://api.github.com/users/dnkolegov/followers","following_url":"https://api.github.com/users/dnkolegov/following{/other_user}","gists_url":"https://api.github.com/users/dnkolegov/gists{/gist_id}","starred_url":"https://api.github.com/users/dnkolegov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnkolegov/subscriptions","organizations_url":"https://api.github.com/users/dnkolegov/orgs","repos_url":"https://api.github.com/users/dnkolegov/repos","events_url":"https://api.github.com/users/dnkolegov/events{/privacy}","received_events_url":"https://api.github.com/users/dnkolegov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-26T11:11:15Z","updated_at":"2016-05-26T11:11:15Z","closed_at":null,"body":"It would be great if DOMPurify can signal about dangling markup injection like it does for removed nodes.\r\n\r\nFor example:\r\n```\r\nvar dirty = \"<img src='http://evil.com\";\r\nvar clean = DOMPurify.sanitize(dirty);\r\nDOMPurify.dangled\r\n// true\r\n```\r\n\r\nIdea of fix is to check if `body.innerHTML` is empty before [return body](https://github.com/cure53/DOMPurify/blob/master/src/purify.js#L783) in `DOMPurify.sanitize`:\r\n\r\n```\r\nDOMPurify.dangled = false;\r\n...\r\nif (!body.innerHTML) {\r\n    DOMPurify.dangled = true;\r\n}\r\nreturn WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\r\n```\r\n\r\n\r\nThanks."}}
{"actor":{"display_login":"dnkolegov"}}