{"action":"created","issue":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-jade/issues/103","labels_url":"https://api.github.com/repos/gruntjs/grunt-contrib-jade/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/gruntjs/grunt-contrib-jade/issues/103/comments","events_url":"https://api.github.com/repos/gruntjs/grunt-contrib-jade/issues/103/events","html_url":"https://github.com/gruntjs/grunt-contrib-jade/issues/103","id":36543410,"number":103,"title":"filter compile not working with Jade filters via Grunt","user":{"login":"Grawl","id":846774,"avatar_url":"https://avatars.githubusercontent.com/u/846774?v=3","gravatar_id":"","url":"https://api.github.com/users/Grawl","html_url":"https://github.com/Grawl","followers_url":"https://api.github.com/users/Grawl/followers","following_url":"https://api.github.com/users/Grawl/following{/other_user}","gists_url":"https://api.github.com/users/Grawl/gists{/gist_id}","starred_url":"https://api.github.com/users/Grawl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grawl/subscriptions","organizations_url":"https://api.github.com/users/Grawl/orgs","repos_url":"https://api.github.com/users/Grawl/repos","events_url":"https://api.github.com/users/Grawl/events{/privacy}","received_events_url":"https://api.github.com/users/Grawl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-06-26T03:51:13Z","updated_at":"2015-03-26T05:39:57Z","closed_at":"2014-12-23T21:02:59Z","body":"I don't know where I can get help with this so I will write this issue into all related repositories: this, [`visionmedia/jade#1503`](https://github.com/visionmedia/jade/issues/1503) and [`btwael/mammouth#36`](https://github.com/btwael/mammouth/issues/36).\r\n\r\nI am trying to add Mammouth filter to [`grunt-contrib-jade`](https://github.com/gruntjs/grunt-contrib-jade).\r\n\r\n`filters.js`\r\n```js\r\nvar jadefilters=module.exports={};\r\njadefilters.mammouth=function(str){\r\n\treturn require('mammouth').compile(str);\r\n};\r\n```\r\n\r\n`gruntfile.coffee`\r\n```coffee\r\n\t\tjade:\r\n\t\t\tcompile:\r\n\t\t\t\toptions:\r\n\t\t\t\t\tdata:(dest,src) ->\r\n\t\t\t\t\t\treturn require('./locals.json')\r\n\t\t\t\t\tfilters: require('./filters.js')\r\n\t\t\t\tfiles:[\r\n\t\t\t\t\texpand:true\r\n\t\t\t\t\tcwd:'<%=locals.path.src%>/templates/'\r\n\t\t\t\t\tsrc:'*.jade'\r\n\t\t\t\t\tdest:'<%=locals.path.dev%>'\r\n\t\t\t\t\text:'.php'\r\n\t\t\t\t]\r\n```\r\n\r\n`index.jade`\r\n```jade\r\ndoctype html\r\nhtml\r\n\tbody\r\n\t\t:mammouth\r\n\t\t\tlist = [1, 2, 3, 4, 5]\r\n```\r\n\r\nAnd I get this:\r\n\r\n```\r\nRunning \"jade:compile\" (jade) task\r\n[ { type: 'embed', content: 'list = [1, 2, 3, 4, 5]' } ]\r\nFile test/index.php created.\r\n```\r\n\r\nSo I have Mammouth code instead of compiled PHP.\r\n\r\n`index.php`\r\n\r\n```html\r\n<!DOCTYPE html><html><body>list = [1, 2, 3, 4, 5]</body></html>\r\n```\r\n\r\nBut I want to get this:\r\n\r\n`index.php`\r\n\r\n```php\r\n<!DOCTYPE html><html><body><?$list = array(1, 2, 3, 4, 5);?></body></html>\r\n```\r\n\r\n`mammouth` is installed globally and in a project with `sudo npm install --save`."},"comment":{"url":"https://api.github.com/repos/gruntjs/grunt-contrib-jade/issues/comments/86350365","html_url":"https://github.com/gruntjs/grunt-contrib-jade/issues/103#issuecomment-86350365","issue_url":"https://api.github.com/repos/gruntjs/grunt-contrib-jade/issues/103","id":86350365,"user":{"login":"shinnn","id":1131567,"avatar_url":"https://avatars.githubusercontent.com/u/1131567?v=3","gravatar_id":"","url":"https://api.github.com/users/shinnn","html_url":"https://github.com/shinnn","followers_url":"https://api.github.com/users/shinnn/followers","following_url":"https://api.github.com/users/shinnn/following{/other_user}","gists_url":"https://api.github.com/users/shinnn/gists{/gist_id}","starred_url":"https://api.github.com/users/shinnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinnn/subscriptions","organizations_url":"https://api.github.com/users/shinnn/orgs","repos_url":"https://api.github.com/users/shinnn/repos","events_url":"https://api.github.com/users/shinnn/events{/privacy}","received_events_url":"https://api.github.com/users/shinnn/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T05:39:57Z","updated_at":"2015-03-26T05:39:57Z","body":"`sass.render` is an asynchronous function. https://github.com/sass/node-sass#render-callback--v300\r\n"}}