{"action":"created","issue":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/1054","labels_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1054/labels{/name}","comments_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1054/comments","events_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1054/events","html_url":"https://github.com/wycats/handlebars.js/pull/1054","id":93580060,"number":1054,"title":"Compile failing when partial is an instance of Handlebars.SafeString","user":{"login":"rd5","id":1329477,"avatar_url":"https://avatars.githubusercontent.com/u/1329477?v=3","gravatar_id":"","url":"https://api.github.com/users/rd5","html_url":"https://github.com/rd5","followers_url":"https://api.github.com/users/rd5/followers","following_url":"https://api.github.com/users/rd5/following{/other_user}","gists_url":"https://api.github.com/users/rd5/gists{/gist_id}","starred_url":"https://api.github.com/users/rd5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rd5/subscriptions","organizations_url":"https://api.github.com/users/rd5/orgs","repos_url":"https://api.github.com/users/rd5/repos","events_url":"https://api.github.com/users/rd5/events{/privacy}","received_events_url":"https://api.github.com/users/rd5/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-07T17:05:52Z","updated_at":"2015-07-30T15:04:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wycats/handlebars.js/pulls/1054","html_url":"https://github.com/wycats/handlebars.js/pull/1054","diff_url":"https://github.com/wycats/handlebars.js/pull/1054.diff","patch_url":"https://github.com/wycats/handlebars.js/pull/1054.patch"},"body":"When partial's `indent` option is used, runtime compilation of string partial is failing for partials produced by `Handlebars.SafeString` because of `split` method call.\r\n\r\n```js\r\nlet lines = result.split('\\n');\r\n```\r\nhttps://github.com/wycats/handlebars.js/blob/master/lib/handlebars/runtime.js#L52\r\n\r\nSee [jsfiddle demo](http://jsfiddle.net/j1j60b0u/) for details.\r\n\r\nI have fixed it in a straight way by explicitly calling `result.toString()`."},"comment":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/comments/126361153","html_url":"https://github.com/wycats/handlebars.js/pull/1054#issuecomment-126361153","issue_url":"https://api.github.com/repos/wycats/handlebars.js/issues/1054","id":126361153,"user":{"login":"kpdecker","id":196390,"avatar_url":"https://avatars.githubusercontent.com/u/196390?v=3","gravatar_id":"","url":"https://api.github.com/users/kpdecker","html_url":"https://github.com/kpdecker","followers_url":"https://api.github.com/users/kpdecker/followers","following_url":"https://api.github.com/users/kpdecker/following{/other_user}","gists_url":"https://api.github.com/users/kpdecker/gists{/gist_id}","starred_url":"https://api.github.com/users/kpdecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpdecker/subscriptions","organizations_url":"https://api.github.com/users/kpdecker/orgs","repos_url":"https://api.github.com/users/kpdecker/repos","events_url":"https://api.github.com/users/kpdecker/events{/privacy}","received_events_url":"https://api.github.com/users/kpdecker/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T15:04:41Z","updated_at":"2015-07-30T15:04:41Z","body":"You raise an interesting point. I was surprised that you were able to cause a safe string return from a partial in the first place. Modifying your example a little bit, http://jsfiddle.net/j1j60b0u/1/, shows that a template with a simple wrapper can return a SafeString as well, which could lead to issues down the road. I think we need to make sure that the return from any template, partial or not, is always a string and have proper tests to ensure that :)"}}