{"action":"opened","issue":{"url":"https://api.github.com/repos/htacg/tidy-html5/issues/373","repository_url":"https://api.github.com/repos/htacg/tidy-html5","labels_url":"https://api.github.com/repos/htacg/tidy-html5/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/htacg/tidy-html5/issues/373/comments","events_url":"https://api.github.com/repos/htacg/tidy-html5/issues/373/events","html_url":"https://github.com/htacg/tidy-html5/issues/373","id":133561739,"number":373,"title":"Null Char in XML result document","user":{"login":"geoffmcl","id":1333435,"avatar_url":"https://avatars.githubusercontent.com/u/1333435?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffmcl","html_url":"https://github.com/geoffmcl","followers_url":"https://api.github.com/users/geoffmcl/followers","following_url":"https://api.github.com/users/geoffmcl/following{/other_user}","gists_url":"https://api.github.com/users/geoffmcl/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffmcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffmcl/subscriptions","organizations_url":"https://api.github.com/users/geoffmcl/orgs","repos_url":"https://api.github.com/users/geoffmcl/repos","events_url":"https://api.github.com/users/geoffmcl/events{/privacy}","received_events_url":"https://api.github.com/users/geoffmcl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-14T17:59:56Z","updated_at":"2016-02-14T17:59:56Z","closed_at":null,"body":"See [sf905](https://sourceforge.net/p/tidy/bugs/905/) created: 2009-03-11 by christophe chenon.\r\n\r\nI suggested a patch back then, but for whatever reason it never made it into the code so the bug remained.\r\n\r\nInput: cfg -xml\r\n\r\n```\r\n<entry>\r\n<edef>A string of the form &#xdddd or &#dddd</edef>\r\n</entry>\r\n```\r\n\r\nOutput: where the tilde, `~`, represents a null character.\r\n\r\n```\r\nline 2 column 28 - Warning: unescaped & or unknown entity \"&#xdddd\"\r\nline 2 column 39 - Warning: entity \"&#\" doesn't end in ';'\r\nTidy found 2 warnings and 0 errors!\r\n<entry>\r\n<edef>A string of the form &amp;#xdddd or ~dddd</edef>\r\n</entry>\r\n```\r\n\r\nStrangely, if you add `--preserve-entities yes` to the config, the output is better -\r\n\r\n```\r\n<entry>\r\n<edef>A string of the form &#xdddd or &#;dddd</edef>\r\n</entry>\r\n```\r\n\r\nPresently working on an improved patch...\r\n"}}