{"action":"created","issue":{"url":"https://api.github.com/repos/rexxars/react-markdown/issues/223","repository_url":"https://api.github.com/repos/rexxars/react-markdown","labels_url":"https://api.github.com/repos/rexxars/react-markdown/issues/223/labels{/name}","comments_url":"https://api.github.com/repos/rexxars/react-markdown/issues/223/comments","events_url":"https://api.github.com/repos/rexxars/react-markdown/issues/223/events","html_url":"https://github.com/rexxars/react-markdown/pull/223","id":364176382,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4NDI4ODU0","number":223,"title":"Add ignoreTokens prop to allow skipping parse of specific Markdown tokens","user":{"login":"bjudson","id":542813,"node_id":"MDQ6VXNlcjU0MjgxMw==","avatar_url":"https://avatars0.githubusercontent.com/u/542813?v=4","gravatar_id":"","url":"https://api.github.com/users/bjudson","html_url":"https://github.com/bjudson","followers_url":"https://api.github.com/users/bjudson/followers","following_url":"https://api.github.com/users/bjudson/following{/other_user}","gists_url":"https://api.github.com/users/bjudson/gists{/gist_id}","starred_url":"https://api.github.com/users/bjudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjudson/subscriptions","organizations_url":"https://api.github.com/users/bjudson/orgs","repos_url":"https://api.github.com/users/bjudson/repos","events_url":"https://api.github.com/users/bjudson/events{/privacy}","received_events_url":"https://api.github.com/users/bjudson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-26T19:29:49Z","updated_at":"2018-10-03T19:41:47Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/rexxars/react-markdown/pulls/223","html_url":"https://github.com/rexxars/react-markdown/pull/223","diff_url":"https://github.com/rexxars/react-markdown/pull/223.diff","patch_url":"https://github.com/rexxars/react-markdown/pull/223.patch"},"body":"Here's a proof of concept for the ability to disable parsing of specific tokens. I'm not excited about the level of messing with the parser prototype. And it does seem that some tokenizers just can't be disabled without throwing errors (eg a `list` tokenizer reference is hardcoded, so it can't be removed without breaking other things). In the test, I included the full list of tokenizers, and commented out the ones that don't seem to be cleanly removable. \r\n\r\nI'm conflicted about this, because the ability to disable parsing of some tokens is a requirement for us, and this seems like the best way to do it. On the other hand, `remark-parse` clearly wasn't designed for disabling these parsers, and the [documented method](https://github.com/remarkjs/remark/tree/master/packages/remark-parse#turning-off-a-tokenizer) for doing so is a brittle hack.\r\n\r\nIf it makes sense to move forward, there are some more tests, error handling & refactoring I plan to do, but just want to get some general feedback before spending more time on it.\r\n\r\nEager to hear others' thoughts on this approach."},"comment":{"url":"https://api.github.com/repos/rexxars/react-markdown/issues/comments/426772633","html_url":"https://github.com/rexxars/react-markdown/pull/223#issuecomment-426772633","issue_url":"https://api.github.com/repos/rexxars/react-markdown/issues/223","id":426772633,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjc3MjYzMw==","user":{"login":"bjudson","id":542813,"node_id":"MDQ6VXNlcjU0MjgxMw==","avatar_url":"https://avatars0.githubusercontent.com/u/542813?v=4","gravatar_id":"","url":"https://api.github.com/users/bjudson","html_url":"https://github.com/bjudson","followers_url":"https://api.github.com/users/bjudson/followers","following_url":"https://api.github.com/users/bjudson/following{/other_user}","gists_url":"https://api.github.com/users/bjudson/gists{/gist_id}","starred_url":"https://api.github.com/users/bjudson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjudson/subscriptions","organizations_url":"https://api.github.com/users/bjudson/orgs","repos_url":"https://api.github.com/users/bjudson/repos","events_url":"https://api.github.com/users/bjudson/events{/privacy}","received_events_url":"https://api.github.com/users/bjudson/received_events","type":"User","site_admin":false},"created_at":"2018-10-03T19:41:47Z","updated_at":"2018-10-03T19:41:47Z","author_association":"NONE","body":"I was about to start making a remark plugin for this, and discovered that one already exists (not sure why my previous searches didn't bring it up):\r\nhttps://github.com/zestedesavoir/zmarkdown/tree/master/packages/remark-disable-tokenizers\r\n\r\nI installed this and it is working well for me so far:\r\n```\r\nimport remarkDisableTokenizers from \"remark-disable-tokenizers\";\r\n\r\n<ReactMarkdown\r\n  plugins={[\r\n    [\r\n      remarkDisableTokenizers,\r\n      { block: [\"blockquote\", \"indentedCode\", \"fencedCode\", \"table\"], inline: [\"code\"] }\r\n    ]\r\n  ]}>\r\n  {item.data.content}\r\n</ReactMarkdown>\r\n```\r\n\r\nAs far as I'm concerned, we can close this PR and link to the plugin from the related issues."}}
{"actor":{"display_login":"bjudson"}}