{"action":"created","issue":{"url":"https://api.github.com/repos/getnikola/nikola/issues/1768","labels_url":"https://api.github.com/repos/getnikola/nikola/issues/1768/labels{/name}","comments_url":"https://api.github.com/repos/getnikola/nikola/issues/1768/comments","events_url":"https://api.github.com/repos/getnikola/nikola/issues/1768/events","html_url":"https://github.com/getnikola/nikola/issues/1768","id":82563237,"number":1768,"title":"Nikola makes HTML5 video source tags invalid","user":{"login":"felixfontein","id":5781356,"avatar_url":"https://avatars.githubusercontent.com/u/5781356?v=3","gravatar_id":"","url":"https://api.github.com/users/felixfontein","html_url":"https://github.com/felixfontein","followers_url":"https://api.github.com/users/felixfontein/followers","following_url":"https://api.github.com/users/felixfontein/following{/other_user}","gists_url":"https://api.github.com/users/felixfontein/gists{/gist_id}","starred_url":"https://api.github.com/users/felixfontein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixfontein/subscriptions","organizations_url":"https://api.github.com/users/felixfontein/orgs","repos_url":"https://api.github.com/users/felixfontein/repos","events_url":"https://api.github.com/users/felixfontein/events{/privacy}","received_events_url":"https://api.github.com/users/felixfontein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/getnikola/nikola/labels/someone%20else's%20bug","name":"someone else's bug","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-05-29T19:57:20Z","updated_at":"2015-06-03T23:32:58Z","closed_at":null,"body":"If you use a `<video>` element with a `<source>` tag in a post, theme, ..., Nikola generates a `</source>` for every `<source ...>`, which is not valid HTML5.\r\n\r\nThis happens in the last few lines of `Nikola.render_template()` in `nikola/nikola.py`:\r\n```\r\nparser = lxml.html.HTMLParser(remove_blank_text=True)\r\ndoc = lxml.html.document_fromstring(data, parser)\r\ndoc.rewrite_links(lambda dst: self.url_replacer(src, dst, context['lang']))\r\ndata = b'<!DOCTYPE html>\\n' + lxml.html.tostring(doc, encoding='utf8', method='html', pretty_print=True)\r\n```\r\nThis is a problem of lxml.html (or maybe of something they use), so nothing we can easily fix.\r\n\r\nI'll try to investigate more when I'm more motivated and have some more time... (For my blog, I can \"fix\" this by replacing \"</source>\" with \"\" in all .html files... That's no good solution in general, though...)"},"comment":{"url":"https://api.github.com/repos/getnikola/nikola/issues/comments/108646686","html_url":"https://github.com/getnikola/nikola/issues/1768#issuecomment-108646686","issue_url":"https://api.github.com/repos/getnikola/nikola/issues/1768","id":108646686,"user":{"login":"ralsina","id":1579,"avatar_url":"https://avatars.githubusercontent.com/u/1579?v=3","gravatar_id":"","url":"https://api.github.com/users/ralsina","html_url":"https://github.com/ralsina","followers_url":"https://api.github.com/users/ralsina/followers","following_url":"https://api.github.com/users/ralsina/following{/other_user}","gists_url":"https://api.github.com/users/ralsina/gists{/gist_id}","starred_url":"https://api.github.com/users/ralsina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralsina/subscriptions","organizations_url":"https://api.github.com/users/ralsina/orgs","repos_url":"https://api.github.com/users/ralsina/repos","events_url":"https://api.github.com/users/ralsina/events{/privacy}","received_events_url":"https://api.github.com/users/ralsina/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T23:32:58Z","updated_at":"2015-06-03T23:32:58Z","body":"If we refactor \"write this tree to a file\" into a separate function (which we should anyway, because it's duplicated) we can make this all work easy and improve the code quality and test coverage at the same time."}}