{"action":"created","issue":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/1209","repository_url":"https://api.github.com/repos/wycats/handlebars.js","labels_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1209/labels{/name}","comments_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1209/comments","events_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1209/events","html_url":"https://github.com/wycats/handlebars.js/issues/1209","id":146729813,"number":1209,"title":"Handlebars wraps / escapes <!DOCTYPE html> (in metalsmith)","user":{"login":"diroru","id":710482,"avatar_url":"https://avatars.githubusercontent.com/u/710482?v=3","gravatar_id":"","url":"https://api.github.com/users/diroru","html_url":"https://github.com/diroru","followers_url":"https://api.github.com/users/diroru/followers","following_url":"https://api.github.com/users/diroru/following{/other_user}","gists_url":"https://api.github.com/users/diroru/gists{/gist_id}","starred_url":"https://api.github.com/users/diroru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diroru/subscriptions","organizations_url":"https://api.github.com/users/diroru/orgs","repos_url":"https://api.github.com/users/diroru/repos","events_url":"https://api.github.com/users/diroru/events{/privacy}","received_events_url":"https://api.github.com/users/diroru/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-07T20:10:46Z","updated_at":"2016-04-08T09:50:53Z","closed_at":"2016-04-08T09:50:53Z","body":"Hello,\r\n\r\ni am sorry but i don't know if it is a `handlebars` or `metalsmith` specific bug. I just simply can't get a doctype declaration into my final html. Have been trying direct declaration in the template file and with the `SafeString()` function. The latter yielded following results:\r\n\r\na) a _conventional_ element (e.g. `<div>`) inside the `<html>` block gets rendered, as expected, without changes.\r\n\r\nb) a _conventional_ element before the `<html>` block gets rendered ok, but is placed inside a `<p>` tag.\r\n\r\nc) a _doctype_ element inside the `<html>` block gets rendered as pure text, like this: `&lt;!DOCTYPE html&gt;`\r\n\r\nd) a _doctype_ element before the `<html>` block will be rendered in the same manner but wrapped in a `<p>` element.\r\n\r\nThis is the helper function in question: \r\n\r\n```\r\nhandlebars.registerHelper('doctype', function() {\r\n  return new handlebars.SafeString(\"<!DOCTYPE html>\");\r\n});\r\n```\r\n\r\nI would like to know if this bug is reproducible in other systems. I personally use `handlebars`  `^4.0.5` with `metalsmith` `^2.1.0`. Please somebody tell me that an evil virus is hijacking my build script :)\r\n\r\nAny help would be appreciated.\r\n\r\nCheers,\r\ndimitar"},"comment":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/comments/207354003","html_url":"https://github.com/wycats/handlebars.js/issues/1209#issuecomment-207354003","issue_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1209","id":207354003,"user":{"login":"diroru","id":710482,"avatar_url":"https://avatars.githubusercontent.com/u/710482?v=3","gravatar_id":"","url":"https://api.github.com/users/diroru","html_url":"https://github.com/diroru","followers_url":"https://api.github.com/users/diroru/followers","following_url":"https://api.github.com/users/diroru/following{/other_user}","gists_url":"https://api.github.com/users/diroru/gists{/gist_id}","starred_url":"https://api.github.com/users/diroru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diroru/subscriptions","organizations_url":"https://api.github.com/users/diroru/orgs","repos_url":"https://api.github.com/users/diroru/repos","events_url":"https://api.github.com/users/diroru/events{/privacy}","received_events_url":"https://api.github.com/users/diroru/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T09:50:53Z","updated_at":"2016-04-08T09:50:53Z","body":"Seems to be a `metalsmith` transformation- / plugin-related issue."}}