{"action":"opened","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5269","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5269/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5269/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/5269/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/5269","id":320165587,"number":5269,"title":"[gatsby-transformer-remark] plugin only works on file nodes","user":{"login":"matthias-reis","id":4521923,"avatar_url":"https://avatars1.githubusercontent.com/u/4521923?v=4","gravatar_id":"","url":"https://api.github.com/users/matthias-reis","html_url":"https://github.com/matthias-reis","followers_url":"https://api.github.com/users/matthias-reis/followers","following_url":"https://api.github.com/users/matthias-reis/following{/other_user}","gists_url":"https://api.github.com/users/matthias-reis/gists{/gist_id}","starred_url":"https://api.github.com/users/matthias-reis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthias-reis/subscriptions","organizations_url":"https://api.github.com/users/matthias-reis/orgs","repos_url":"https://api.github.com/users/matthias-reis/repos","events_url":"https://api.github.com/users/matthias-reis/events{/privacy}","received_events_url":"https://api.github.com/users/matthias-reis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-04T06:29:02Z","updated_at":"2018-05-04T06:29:02Z","closed_at":null,"author_association":"NONE","body":"## Description\r\n\r\nThe pipeline regarding remark/markdown is awesome, but in my understanding of the code (current master) it only works on file nodes.\r\nCurrently, I have an xml file (rss containing markdown) containing markdown cdata and I would like to process this through the remark pipeline as well. My idea was, to source this via file loader, write an onCreateNode handler and create new nodes from that.\r\n\r\n## Suggestion\r\n\r\nIt's all about this line in the source code https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-transformer-remark/src/on-node-create.js#L19.\r\n\r\nA simple solution would allow the node to already contain content like \r\n\r\n```js\r\nconst getContent = () => {\r\n  if(node.content) {\r\n    return promise.resolve(node.content);\r\n  } else {\r\n    return loadContent(node)\r\n  }\r\n}\r\nconst content = await getContent()\r\n```\r\n\r\nA more elaborate / architectural solution would be to separate the IO part from the actual md parsing part more clearly.\r\n\r\n## Expected result\r\n\r\nI can manually create nodes that can be transformed by the `gatsby-transformer-remark` pipeline.\r\n"}}
{"actor":{"display_login":"matthias-reis"}}