{"action":"created","issue":{"url":"https://api.github.com/repos/LeaVerou/prism/issues/487","labels_url":"https://api.github.com/repos/LeaVerou/prism/issues/487/labels{/name}","comments_url":"https://api.github.com/repos/LeaVerou/prism/issues/487/comments","events_url":"https://api.github.com/repos/LeaVerou/prism/issues/487/events","html_url":"https://github.com/LeaVerou/prism/issues/487","id":55786250,"number":487,"title":"PHP Highlighter interprets '#' as beginning a comment, even if its in a string.","user":{"login":"milesblackwood","id":1195879,"avatar_url":"https://avatars.githubusercontent.com/u/1195879?v=3","gravatar_id":"","url":"https://api.github.com/users/milesblackwood","html_url":"https://github.com/milesblackwood","followers_url":"https://api.github.com/users/milesblackwood/followers","following_url":"https://api.github.com/users/milesblackwood/following{/other_user}","gists_url":"https://api.github.com/users/milesblackwood/gists{/gist_id}","starred_url":"https://api.github.com/users/milesblackwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milesblackwood/subscriptions","organizations_url":"https://api.github.com/users/milesblackwood/orgs","repos_url":"https://api.github.com/users/milesblackwood/repos","events_url":"https://api.github.com/users/milesblackwood/events{/privacy}","received_events_url":"https://api.github.com/users/milesblackwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-28T17:18:03Z","updated_at":"2015-01-29T00:20:56Z","closed_at":null,"body":"Totally valid PHP is being mis-highlighted by Prism.js. Instead of treating any characters inside single quotes as part of that string, the '#' hash symbol is turning a line into a comment. Here's a trivial example:\r\n![screen shot 2015-01-28 at 12 12 28 pm](https://cloud.githubusercontent.com/assets/1195879/5942774/b225c1ba-a6e7-11e4-9c5b-46ed46be93b6.png)\r\n"},"comment":{"url":"https://api.github.com/repos/LeaVerou/prism/issues/comments/71945380","html_url":"https://github.com/LeaVerou/prism/issues/487#issuecomment-71945380","issue_url":"https://api.github.com/repos/LeaVerou/prism/issues/487","id":71945380,"user":{"login":"milesblackwood","id":1195879,"avatar_url":"https://avatars.githubusercontent.com/u/1195879?v=3","gravatar_id":"","url":"https://api.github.com/users/milesblackwood","html_url":"https://github.com/milesblackwood","followers_url":"https://api.github.com/users/milesblackwood/followers","following_url":"https://api.github.com/users/milesblackwood/following{/other_user}","gists_url":"https://api.github.com/users/milesblackwood/gists{/gist_id}","starred_url":"https://api.github.com/users/milesblackwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milesblackwood/subscriptions","organizations_url":"https://api.github.com/users/milesblackwood/orgs","repos_url":"https://api.github.com/users/milesblackwood/repos","events_url":"https://api.github.com/users/milesblackwood/events{/privacy}","received_events_url":"https://api.github.com/users/milesblackwood/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T00:20:56Z","updated_at":"2015-01-29T00:20:56Z","body":"I was just looking at the /components/prism-php.js\r\n\r\nThe comment pattern gets run all at once: (lines 17 thru 20)\r\n\r\n```\r\n\t'comment': {\r\n\t\tpattern: /(^|[^\\\\])(\\/\\*[\\w\\W]*?\\*\\/|(^|[^:])(\\/\\/|#).*?(\\r?\\n|$))/g,\r\n\t\tlookbehind: true\r\n\t}\r\n```\r\n\r\nThis is the particular capture group causing the issue: `(\\/\\/|#).*?`\r\n\r\nWe are using prism for an internal knowledge-sharing library at my job, so we simply changed that to remove the OR and hash, resulting in `(\\/\\/).*?`. (which if I understand correctly looks for two literal forward slashes, then any number of characters.)\r\n\r\nI don't know much about prism.js, but where would this pattern get moved to match *after* the string matching pattern has run?"}}