{"action":"created","issue":{"url":"https://api.github.com/repos/htacg/tidy-html5/issues/458","repository_url":"https://api.github.com/repos/htacg/tidy-html5","labels_url":"https://api.github.com/repos/htacg/tidy-html5/issues/458/labels{/name}","comments_url":"https://api.github.com/repos/htacg/tidy-html5/issues/458/comments","events_url":"https://api.github.com/repos/htacg/tidy-html5/issues/458/events","html_url":"https://github.com/htacg/tidy-html5/pull/458","id":180819958,"number":458,"title":"WIP: Implement \"add-meta-charset\" option","user":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars.githubusercontent.com/u/870154?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"labels":[{"id":8461214,"url":"https://api.github.com/repos/htacg/tidy-html5/labels/Feature%20Request","name":"Feature Request","color":"02e10c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/htacg/tidy-html5/milestones/9","html_url":"https://github.com/htacg/tidy-html5/milestone/9","labels_url":"https://api.github.com/repos/htacg/tidy-html5/milestones/9/labels","id":2291013,"number":9,"title":"5.5","description":"Headed for next release, after 5.4","creator":{"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},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2017-02-01T00:26:38Z","updated_at":"2017-02-12T21:57:29Z","due_on":"2017-08-15T07:00:00Z","closed_at":null},"comments":17,"created_at":"2016-10-04T07:08:43Z","updated_at":"2017-02-15T01:20:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/htacg/tidy-html5/pulls/458","html_url":"https://github.com/htacg/tidy-html5/pull/458","diff_url":"https://github.com/htacg/tidy-html5/pull/458.diff","patch_url":"https://github.com/htacg/tidy-html5/pull/458.patch"},"body":"Covers initial implementation of \"add-meta-charset\".\n\n@geoffmcl, this lays down the initial infrastructure. \n\nI have a couple of follow up questions: \n1.  Even though tidy picks up the new option, Tidy's command line output still shows: \n\n``` Bash\nConfig: unknown option: add-meta-charset=true\n```\n\nAnything obvious I've missed? The code is definitely working, as I can see the right element being added for HTML, and XHTML.\n1. I'm getting null pointers when trying to match `*charsetAttr` and `*httpEquivAttr` in lexer.c, but can't work out why? Line 1691, 1692 below.  \n\nI'm worried about what to do when we hit something like:\n\n``` HTML\n<meta http-equiv=\"content-type\" content=\"text/html;charset=SOMETHING\">\n```\n\nWhere SOMETHING doesn't match the output encoding. I think all we can do there is warn the developer - as they have opted into this option, we can only assume they know what they are doing.\n\nThe warning would be something like:\n\n``` BASH\nline X column X - Warning: found redundant charset declaration. \n```\n\nQuestion is, should I still just insert the correct `<meta charset>`? \n\nLastly, if there is an valid declaration, that matches the output format, then it should be removed from the DOM. Then I can add the equivalent one to the document's head. \n\nWDYT? \n"},"comment":{"url":"https://api.github.com/repos/htacg/tidy-html5/issues/comments/279889537","html_url":"https://github.com/htacg/tidy-html5/pull/458#issuecomment-279889537","issue_url":"https://api.github.com/repos/htacg/tidy-html5/issues/458","id":279889537,"user":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars.githubusercontent.com/u/870154?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"created_at":"2017-02-15T01:20:13Z","updated_at":"2017-02-15T01:20:13Z","body":"@geoffmcl, this was getting close... just needed to replace the `printf()` with actual tidy warnings. I was unsure how to add test cases for this also. I could use some help with both of those things. "}}
{"actor":{"display_login":"marcoscaceres"}}