{"action":"created","issue":{"url":"https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/issues/38","labels_url":"https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/issues/38/comments","events_url":"https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/issues/38/events","html_url":"https://github.com/GrahamCampbell/Laravel-Markdown/issues/38","id":114398570,"number":38,"title":"No method to escape user-inputted markdown","user":{"login":"gytdau","id":8823299,"avatar_url":"https://avatars.githubusercontent.com/u/8823299?v=3","gravatar_id":"","url":"https://api.github.com/users/gytdau","html_url":"https://github.com/gytdau","followers_url":"https://api.github.com/users/gytdau/followers","following_url":"https://api.github.com/users/gytdau/following{/other_user}","gists_url":"https://api.github.com/users/gytdau/gists{/gist_id}","starred_url":"https://api.github.com/users/gytdau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gytdau/subscriptions","organizations_url":"https://api.github.com/users/gytdau/orgs","repos_url":"https://api.github.com/users/gytdau/repos","events_url":"https://api.github.com/users/gytdau/events{/privacy}","received_events_url":"https://api.github.com/users/gytdau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-31T08:47:21Z","updated_at":"2015-10-31T10:09:25Z","closed_at":"2015-10-31T10:02:34Z","body":"There's no satisfactory way to escape user-submitted Markdown as it uses the the angle bracket `>` for a block quote, which is escaped by Laravel into `&gt;` by default.\r\n\r\nExample:\r\n```\r\n# Title 1\r\n\r\n<script src=\"example.com\"></script>\r\n\r\n> Blockquote\r\n```\r\n\r\nEscaped:\r\n\r\n```\r\n# Title 1\r\n\r\n&lt;script src=&quot;example.com&quot;&gt;&lt;/script&gt;\r\n\r\n&gt; Blockquote\r\n```\r\nThe issue here is that the blockquote is no longer recognized as valid Markdown. One solution could be adding an escape function that ignores all right-angle brackets, which would instead convert it to:\r\n```\r\n# Title 1\r\n\r\n&lt;script src=&quot;example.com&quot;>&lt;/script>\r\n\r\n> Blockquote\r\n```\r\n... which then would result in the expected Markdown, with the blockquote intact."},"comment":{"url":"https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/issues/comments/152719725","html_url":"https://github.com/GrahamCampbell/Laravel-Markdown/issues/38#issuecomment-152719725","issue_url":"https://api.github.com/repos/GrahamCampbell/Laravel-Markdown/issues/38","id":152719725,"user":{"login":"gytdau","id":8823299,"avatar_url":"https://avatars.githubusercontent.com/u/8823299?v=3","gravatar_id":"","url":"https://api.github.com/users/gytdau","html_url":"https://github.com/gytdau","followers_url":"https://api.github.com/users/gytdau/followers","following_url":"https://api.github.com/users/gytdau/following{/other_user}","gists_url":"https://api.github.com/users/gytdau/gists{/gist_id}","starred_url":"https://api.github.com/users/gytdau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gytdau/subscriptions","organizations_url":"https://api.github.com/users/gytdau/orgs","repos_url":"https://api.github.com/users/gytdau/repos","events_url":"https://api.github.com/users/gytdau/events{/privacy}","received_events_url":"https://api.github.com/users/gytdau/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T10:09:25Z","updated_at":"2015-10-31T10:09:25Z","body":"The package you mentioned looks like it'd only remove XSS vulnerabilities, but what about other things like the style attribute? That has a lot of potential for misuse, too.\r\n\r\n\r\n"}}