{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/platform/pulls/comments/36190934","id":36190934,"diff_hunk":"@@ -420,12 +491,32 @@ module.exports.textToJsx = function(text, options) {\n         var highlightSearchClass = \"\";\n         for (var z = 0; z < words.length; z++) {\n             var word = words[z];\n-            var trimWord = word.replace(puncStartRegex, '').replace(puncEndRegex, '').trim();\n+            var trimWord;\n+            if (useMarkdown) {\n+                trimWord = word.replace(endTagRegex, '').replace(startTagRegex, '').replace(puncStartRegex, '').replace(puncEndRegex, '').trim();\n+            } else {\n+                trimWord = word.replace(puncStartRegex, '').replace(puncEndRegex, '').trim();\n+            }\n             var mentionRegex = /^(?:@)([a-z0-9_]+)$/gi; // looks loop invariant but a weird JS bug needs it to be redefined here\n             var explicitMention = mentionRegex.exec(trimWord);\n+            console.log(word);","path":"web/react/utils/utils.jsx","position":132,"original_position":132,"commit_id":"259f7b16bc4ad6be2d982648114dbb137af59d05","original_commit_id":"259f7b16bc4ad6be2d982648114dbb137af59d05","user":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars.githubusercontent.com/u/3277310?v=3","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"body":"Another debug statement","created_at":"2015-08-04T14:04:37Z","updated_at":"2015-08-04T14:04:37Z","html_url":"https://github.com/mattermost/platform/pull/327#discussion_r36190934","pull_request_url":"https://api.github.com/repos/mattermost/platform/pulls/327","_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments/36190934"},"html":{"href":"https://github.com/mattermost/platform/pull/327#discussion_r36190934"},"pull_request":{"href":"https://api.github.com/repos/mattermost/platform/pulls/327"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/platform/pulls/327","id":41525134,"html_url":"https://github.com/mattermost/platform/pull/327","diff_url":"https://github.com/mattermost/platform/pull/327.diff","patch_url":"https://github.com/mattermost/platform/pull/327.patch","issue_url":"https://api.github.com/repos/mattermost/platform/issues/327","number":327,"state":"open","locked":false,"title":"MM-375 Adds markdown support using marked js library","user":{"login":"rgarmsen2295","id":9124858,"avatar_url":"https://avatars.githubusercontent.com/u/9124858?v=3","gravatar_id":"","url":"https://api.github.com/users/rgarmsen2295","html_url":"https://github.com/rgarmsen2295","followers_url":"https://api.github.com/users/rgarmsen2295/followers","following_url":"https://api.github.com/users/rgarmsen2295/following{/other_user}","gists_url":"https://api.github.com/users/rgarmsen2295/gists{/gist_id}","starred_url":"https://api.github.com/users/rgarmsen2295/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgarmsen2295/subscriptions","organizations_url":"https://api.github.com/users/rgarmsen2295/orgs","repos_url":"https://api.github.com/users/rgarmsen2295/repos","events_url":"https://api.github.com/users/rgarmsen2295/events{/privacy}","received_events_url":"https://api.github.com/users/rgarmsen2295/received_events","type":"User","site_admin":false},"body":"## _Markdown Support_\r\n\r\nThis pull request adds markdown support to anywhere that the textToJsx utility function is called (namely posts and the channel description). Also adds help text under the textbox in the center pane and RHS after a user has typed at least one word informing them of some simple markdown commands with a link for more advanced ones (currently pointing to a GitHub markdown help page, will be changed later).  Primary weirdness (like last edit timestamps) are due to needing to unmount and remount react components when the html is changed due to React not liking the DOM being changed without this.  By modifying the component's key the component is forced to do this.\r\n\r\nAs far as what's quirky and different from plain 'ole markdown\r\n\r\n* No markdown links, e.g. using \"[Example Link](http://example.net/)\" to format a link, we have another library for parsing links that we just got working properly, didn't want to rock the boat too much (some users also complained about the implementation from what I read, but still would be good to have, see below)\r\n* No markdown inline images, similar to above it didn't work and we already have our own file upload system\r\n* No mangling of emails, doubt it would've seen much use (only even tested it towards the end), but it basically wanted to modify the React DOM every time you did anything causing React to panic and crash\r\n* No tables, not part of the standard markdown syntax and were not working\r\n* No directly entering html, we sanitize that, not sanitizing that would be bad\r\n\r\n...otherwise it's pretty much what you would expect, when I had the chance I went for some more modern options such as using \"GitHub\" style paragraphs/line breaks (just do a newline instead of leaving two empty spaces at the end of a line).  \r\n\r\nNext steps would be getting markdown links and possibly tables working, I think the links feature is really cool and useful and probably wouldn't be too much work to get going.  Tables would probably be more work and is not standard but is something to think about.\r\n","created_at":"2015-08-04T00:53:44Z","updated_at":"2015-08-04T14:04:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a30ead16438692492ff4dc61bdd1ee9483eb9ea","assignee":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars.githubusercontent.com/u/3277310?v=3","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mattermost/platform/milestones/2","html_url":"https://github.com/mattermost/platform/milestones/v0.7.0","labels_url":"https://api.github.com/repos/mattermost/platform/milestones/2/labels","id":1229900,"number":2,"title":"v0.7.0","description":"","creator":{"login":"it33","id":177788,"avatar_url":"https://avatars.githubusercontent.com/u/177788?v=3","gravatar_id":"","url":"https://api.github.com/users/it33","html_url":"https://github.com/it33","followers_url":"https://api.github.com/users/it33/followers","following_url":"https://api.github.com/users/it33/following{/other_user}","gists_url":"https://api.github.com/users/it33/gists{/gist_id}","starred_url":"https://api.github.com/users/it33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it33/subscriptions","organizations_url":"https://api.github.com/users/it33/orgs","repos_url":"https://api.github.com/users/it33/repos","events_url":"https://api.github.com/users/it33/events{/privacy}","received_events_url":"https://api.github.com/users/it33/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":5,"state":"open","created_at":"2015-07-28T17:01:12Z","updated_at":"2015-08-04T13:07:04Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mattermost/platform/pulls/327/commits","review_comments_url":"https://api.github.com/repos/mattermost/platform/pulls/327/comments","review_comment_url":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/platform/issues/327/comments","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/259f7b16bc4ad6be2d982648114dbb137af59d05","head":{"label":"rgarmsen2295:mm-375b","ref":"mm-375b","sha":"259f7b16bc4ad6be2d982648114dbb137af59d05","user":{"login":"rgarmsen2295","id":9124858,"avatar_url":"https://avatars.githubusercontent.com/u/9124858?v=3","gravatar_id":"","url":"https://api.github.com/users/rgarmsen2295","html_url":"https://github.com/rgarmsen2295","followers_url":"https://api.github.com/users/rgarmsen2295/followers","following_url":"https://api.github.com/users/rgarmsen2295/following{/other_user}","gists_url":"https://api.github.com/users/rgarmsen2295/gists{/gist_id}","starred_url":"https://api.github.com/users/rgarmsen2295/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgarmsen2295/subscriptions","organizations_url":"https://api.github.com/users/rgarmsen2295/orgs","repos_url":"https://api.github.com/users/rgarmsen2295/repos","events_url":"https://api.github.com/users/rgarmsen2295/events{/privacy}","received_events_url":"https://api.github.com/users/rgarmsen2295/received_events","type":"User","site_admin":false},"repo":{"id":37988993,"name":"platform","full_name":"rgarmsen2295/platform","owner":{"login":"rgarmsen2295","id":9124858,"avatar_url":"https://avatars.githubusercontent.com/u/9124858?v=3","gravatar_id":"","url":"https://api.github.com/users/rgarmsen2295","html_url":"https://github.com/rgarmsen2295","followers_url":"https://api.github.com/users/rgarmsen2295/followers","following_url":"https://api.github.com/users/rgarmsen2295/following{/other_user}","gists_url":"https://api.github.com/users/rgarmsen2295/gists{/gist_id}","starred_url":"https://api.github.com/users/rgarmsen2295/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgarmsen2295/subscriptions","organizations_url":"https://api.github.com/users/rgarmsen2295/orgs","repos_url":"https://api.github.com/users/rgarmsen2295/repos","events_url":"https://api.github.com/users/rgarmsen2295/events{/privacy}","received_events_url":"https://api.github.com/users/rgarmsen2295/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rgarmsen2295/platform","description":"Team communication service across PC and phones, with archiving and search.","fork":true,"url":"https://api.github.com/repos/rgarmsen2295/platform","forks_url":"https://api.github.com/repos/rgarmsen2295/platform/forks","keys_url":"https://api.github.com/repos/rgarmsen2295/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rgarmsen2295/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rgarmsen2295/platform/teams","hooks_url":"https://api.github.com/repos/rgarmsen2295/platform/hooks","issue_events_url":"https://api.github.com/repos/rgarmsen2295/platform/issues/events{/number}","events_url":"https://api.github.com/repos/rgarmsen2295/platform/events","assignees_url":"https://api.github.com/repos/rgarmsen2295/platform/assignees{/user}","branches_url":"https://api.github.com/repos/rgarmsen2295/platform/branches{/branch}","tags_url":"https://api.github.com/repos/rgarmsen2295/platform/tags","blobs_url":"https://api.github.com/repos/rgarmsen2295/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rgarmsen2295/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rgarmsen2295/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/rgarmsen2295/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rgarmsen2295/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/rgarmsen2295/platform/languages","stargazers_url":"https://api.github.com/repos/rgarmsen2295/platform/stargazers","contributors_url":"https://api.github.com/repos/rgarmsen2295/platform/contributors","subscribers_url":"https://api.github.com/repos/rgarmsen2295/platform/subscribers","subscription_url":"https://api.github.com/repos/rgarmsen2295/platform/subscription","commits_url":"https://api.github.com/repos/rgarmsen2295/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/rgarmsen2295/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/rgarmsen2295/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/rgarmsen2295/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/rgarmsen2295/platform/contents/{+path}","compare_url":"https://api.github.com/repos/rgarmsen2295/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rgarmsen2295/platform/merges","archive_url":"https://api.github.com/repos/rgarmsen2295/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rgarmsen2295/platform/downloads","issues_url":"https://api.github.com/repos/rgarmsen2295/platform/issues{/number}","pulls_url":"https://api.github.com/repos/rgarmsen2295/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/rgarmsen2295/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/rgarmsen2295/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rgarmsen2295/platform/labels{/name}","releases_url":"https://api.github.com/repos/rgarmsen2295/platform/releases{/id}","created_at":"2015-06-24T14:21:28Z","updated_at":"2015-07-08T16:09:44Z","pushed_at":"2015-08-04T00:52:29Z","git_url":"git://github.com/rgarmsen2295/platform.git","ssh_url":"git@github.com:rgarmsen2295/platform.git","clone_url":"https://github.com/rgarmsen2295/platform.git","svn_url":"https://github.com/rgarmsen2295/platform","homepage":"http://mattermost.org","size":5637,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattermost:master","ref":"master","sha":"42c5d0d366cb38866dd6d2ce7e8485ac7a2746a4","user":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars.githubusercontent.com/u/9828093?v=3","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":37448451,"name":"platform","full_name":"mattermost/platform","owner":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars.githubusercontent.com/u/9828093?v=3","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mattermost/platform","description":"Open source Slack-alternative in Golang and React","fork":false,"url":"https://api.github.com/repos/mattermost/platform","forks_url":"https://api.github.com/repos/mattermost/platform/forks","keys_url":"https://api.github.com/repos/mattermost/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/platform/teams","hooks_url":"https://api.github.com/repos/mattermost/platform/hooks","issue_events_url":"https://api.github.com/repos/mattermost/platform/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/platform/events","assignees_url":"https://api.github.com/repos/mattermost/platform/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/platform/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/platform/tags","blobs_url":"https://api.github.com/repos/mattermost/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/platform/languages","stargazers_url":"https://api.github.com/repos/mattermost/platform/stargazers","contributors_url":"https://api.github.com/repos/mattermost/platform/contributors","subscribers_url":"https://api.github.com/repos/mattermost/platform/subscribers","subscription_url":"https://api.github.com/repos/mattermost/platform/subscription","commits_url":"https://api.github.com/repos/mattermost/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/platform/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/platform/merges","archive_url":"https://api.github.com/repos/mattermost/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/platform/downloads","issues_url":"https://api.github.com/repos/mattermost/platform/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/platform/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/platform/releases{/id}","created_at":"2015-06-15T06:50:02Z","updated_at":"2015-08-04T11:27:58Z","pushed_at":"2015-08-04T13:59:38Z","git_url":"git://github.com/mattermost/platform.git","ssh_url":"git@github.com:mattermost/platform.git","clone_url":"https://github.com/mattermost/platform.git","svn_url":"https://github.com/mattermost/platform","homepage":"http://mattermost.org","size":8463,"stargazers_count":2443,"watchers_count":2443,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":191,"mirror_url":null,"open_issues_count":21,"forks":191,"open_issues":21,"watchers":2443,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/platform/pulls/327"},"html":{"href":"https://github.com/mattermost/platform/pull/327"},"issue":{"href":"https://api.github.com/repos/mattermost/platform/issues/327"},"comments":{"href":"https://api.github.com/repos/mattermost/platform/issues/327/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/platform/pulls/327/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/platform/pulls/327/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/platform/statuses/259f7b16bc4ad6be2d982648114dbb137af59d05"}}}}