{"action":"created","comment":{"url":"https://api.github.com/repos/exercism/go/pulls/comments/185772239","pull_request_review_id":117227379,"id":185772239,"diff_hunk":"@@ -0,0 +1,77 @@\n+package markdown\n+\n+import (\n+\t\"bytes\"\n+\t\"fmt\"\n+\t\"regexp\"\n+)\n+\n+type charType int\n+\n+// used to keep track of which tag to close\n+const (\n+\tnone charType = iota\n+\thash\n+\tstar\n+)\n+\n+// Render translates markdown to HTML\n+func Render(markdown string) (html string) {\n+\t//first the easy one, via regexp substitution\n+\treStrong := regexp.MustCompile(\"(__)(.*)(__)\")\n+\ts := reStrong.ReplaceAll([]byte(markdown), []byte(\"<strong>$2</strong>\"))\n+\treEm := regexp.MustCompile(\"(_)(.*)(_)\")\n+\ts = reEm.ReplaceAll(s, []byte(\"<em>$2</em>\"))\n+\t//now manage <li> and <hN>\n+\tvar output bytes.Buffer\n+\tstarcount := 0\n+\thcount := 0\n+\tneedtoClose := none\n+\ti := 0\n+\tfor {\n+\t\tswitch s[i] {\n+\t\tcase '#':\n+\t\t\tfor s[i] == '#' {\n+\t\t\t\thcount++\n+\t\t\t\ti++\n+\t\t\t}\n+\t\t\toutput.WriteString(fmt.Sprintf(\"<h%d>\", hcount))\n+\t\t\tneedtoClose = hash\n+\t\tcase '*':\n+\t\t\tif starcount == 0 {\n+\t\t\t\toutput.WriteString(\"<ul>\")\n+\t\t\t}\n+\t\t\ti++\n+\t\t\tstarcount++\n+\t\t\toutput.WriteString(\"<li>\")\n+\t\t\tneedtoClose = star\n+\t\tcase '\\n':\n+\t\t\tif needtoClose == hash {\n+\t\t\t\toutput.WriteString(fmt.Sprintf(\"</h%d>\", hcount))\n+\t\t\t}\n+\t\t\tif needtoClose == star {\n+\t\t\t\toutput.WriteString(\"</li>\")\n+\t\t\t}\n+\n+\t\tdefault:\n+\t\t\toutput.WriteByte(s[i])\n+\n+\t\t}\n+\t\tif i < len(s)-1 {","path":"exercises/markdown/example.go","position":60,"original_position":60,"commit_id":"68860b93d063002bf0fe7b0af927cf56bdbc416d","original_commit_id":"0f47b4e1352e5a63fa45e66acbd7bb57d3a22051","user":{"login":"leenipper","id":17682173,"avatar_url":"https://avatars2.githubusercontent.com/u/17682173?v=4","gravatar_id":"","url":"https://api.github.com/users/leenipper","html_url":"https://github.com/leenipper","followers_url":"https://api.github.com/users/leenipper/followers","following_url":"https://api.github.com/users/leenipper/following{/other_user}","gists_url":"https://api.github.com/users/leenipper/gists{/gist_id}","starred_url":"https://api.github.com/users/leenipper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leenipper/subscriptions","organizations_url":"https://api.github.com/users/leenipper/orgs","repos_url":"https://api.github.com/users/leenipper/repos","events_url":"https://api.github.com/users/leenipper/events{/privacy}","received_events_url":"https://api.github.com/users/leenipper/received_events","type":"User","site_admin":false},"body":"This if / else sequence can drop after for loop condition change.","created_at":"2018-05-03T11:52:20Z","updated_at":"2018-05-03T12:03:10Z","html_url":"https://github.com/exercism/go/pull/1103#discussion_r185772239","pull_request_url":"https://api.github.com/repos/exercism/go/pulls/1103","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/exercism/go/pulls/comments/185772239"},"html":{"href":"https://github.com/exercism/go/pull/1103#discussion_r185772239"},"pull_request":{"href":"https://api.github.com/repos/exercism/go/pulls/1103"}}},"pull_request":{"url":"https://api.github.com/repos/exercism/go/pulls/1103","id":182213536,"html_url":"https://github.com/exercism/go/pull/1103","diff_url":"https://github.com/exercism/go/pull/1103.diff","patch_url":"https://github.com/exercism/go/pull/1103.patch","issue_url":"https://api.github.com/repos/exercism/go/issues/1103","number":1103,"state":"open","locked":false,"title":"proposal for markdown exercise","user":{"login":"ilmanzo","id":1872816,"avatar_url":"https://avatars1.githubusercontent.com/u/1872816?v=4","gravatar_id":"","url":"https://api.github.com/users/ilmanzo","html_url":"https://github.com/ilmanzo","followers_url":"https://api.github.com/users/ilmanzo/followers","following_url":"https://api.github.com/users/ilmanzo/following{/other_user}","gists_url":"https://api.github.com/users/ilmanzo/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmanzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmanzo/subscriptions","organizations_url":"https://api.github.com/users/ilmanzo/orgs","repos_url":"https://api.github.com/users/ilmanzo/repos","events_url":"https://api.github.com/users/ilmanzo/events{/privacy}","received_events_url":"https://api.github.com/users/ilmanzo/received_events","type":"User","site_admin":false},"body":"maybe still need some work; also not very clear how to write the new entry in config.json \"unlocked_by\" ?","created_at":"2018-04-17T15:52:09Z","updated_at":"2018-05-03T12:03:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a24c466e83513300239bf4bafd6b1523a64f23d2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/exercism/go/pulls/1103/commits","review_comments_url":"https://api.github.com/repos/exercism/go/pulls/1103/comments","review_comment_url":"https://api.github.com/repos/exercism/go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exercism/go/issues/1103/comments","statuses_url":"https://api.github.com/repos/exercism/go/statuses/68860b93d063002bf0fe7b0af927cf56bdbc416d","head":{"label":"ilmanzo:impl_markdown","ref":"impl_markdown","sha":"68860b93d063002bf0fe7b0af927cf56bdbc416d","user":{"login":"ilmanzo","id":1872816,"avatar_url":"https://avatars1.githubusercontent.com/u/1872816?v=4","gravatar_id":"","url":"https://api.github.com/users/ilmanzo","html_url":"https://github.com/ilmanzo","followers_url":"https://api.github.com/users/ilmanzo/followers","following_url":"https://api.github.com/users/ilmanzo/following{/other_user}","gists_url":"https://api.github.com/users/ilmanzo/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmanzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmanzo/subscriptions","organizations_url":"https://api.github.com/users/ilmanzo/orgs","repos_url":"https://api.github.com/users/ilmanzo/repos","events_url":"https://api.github.com/users/ilmanzo/events{/privacy}","received_events_url":"https://api.github.com/users/ilmanzo/received_events","type":"User","site_admin":false},"repo":{"id":118275557,"name":"go","full_name":"ilmanzo/go","owner":{"login":"ilmanzo","id":1872816,"avatar_url":"https://avatars1.githubusercontent.com/u/1872816?v=4","gravatar_id":"","url":"https://api.github.com/users/ilmanzo","html_url":"https://github.com/ilmanzo","followers_url":"https://api.github.com/users/ilmanzo/followers","following_url":"https://api.github.com/users/ilmanzo/following{/other_user}","gists_url":"https://api.github.com/users/ilmanzo/gists{/gist_id}","starred_url":"https://api.github.com/users/ilmanzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilmanzo/subscriptions","organizations_url":"https://api.github.com/users/ilmanzo/orgs","repos_url":"https://api.github.com/users/ilmanzo/repos","events_url":"https://api.github.com/users/ilmanzo/events{/privacy}","received_events_url":"https://api.github.com/users/ilmanzo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ilmanzo/go","description":"Exercism exercises in Go.","fork":true,"url":"https://api.github.com/repos/ilmanzo/go","forks_url":"https://api.github.com/repos/ilmanzo/go/forks","keys_url":"https://api.github.com/repos/ilmanzo/go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilmanzo/go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilmanzo/go/teams","hooks_url":"https://api.github.com/repos/ilmanzo/go/hooks","issue_events_url":"https://api.github.com/repos/ilmanzo/go/issues/events{/number}","events_url":"https://api.github.com/repos/ilmanzo/go/events","assignees_url":"https://api.github.com/repos/ilmanzo/go/assignees{/user}","branches_url":"https://api.github.com/repos/ilmanzo/go/branches{/branch}","tags_url":"https://api.github.com/repos/ilmanzo/go/tags","blobs_url":"https://api.github.com/repos/ilmanzo/go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilmanzo/go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilmanzo/go/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilmanzo/go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilmanzo/go/statuses/{sha}","languages_url":"https://api.github.com/repos/ilmanzo/go/languages","stargazers_url":"https://api.github.com/repos/ilmanzo/go/stargazers","contributors_url":"https://api.github.com/repos/ilmanzo/go/contributors","subscribers_url":"https://api.github.com/repos/ilmanzo/go/subscribers","subscription_url":"https://api.github.com/repos/ilmanzo/go/subscription","commits_url":"https://api.github.com/repos/ilmanzo/go/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilmanzo/go/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilmanzo/go/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilmanzo/go/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilmanzo/go/contents/{+path}","compare_url":"https://api.github.com/repos/ilmanzo/go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilmanzo/go/merges","archive_url":"https://api.github.com/repos/ilmanzo/go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilmanzo/go/downloads","issues_url":"https://api.github.com/repos/ilmanzo/go/issues{/number}","pulls_url":"https://api.github.com/repos/ilmanzo/go/pulls{/number}","milestones_url":"https://api.github.com/repos/ilmanzo/go/milestones{/number}","notifications_url":"https://api.github.com/repos/ilmanzo/go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilmanzo/go/labels{/name}","releases_url":"https://api.github.com/repos/ilmanzo/go/releases{/id}","deployments_url":"https://api.github.com/repos/ilmanzo/go/deployments","created_at":"2018-01-20T19:51:17Z","updated_at":"2018-04-18T12:50:18Z","pushed_at":"2018-04-19T08:41:02Z","git_url":"git://github.com/ilmanzo/go.git","ssh_url":"git@github.com:ilmanzo/go.git","clone_url":"https://github.com/ilmanzo/go.git","svn_url":"https://github.com/ilmanzo/go","homepage":"http://exercism.io/languages/go","size":2497,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"exercism:master","ref":"master","sha":"3250a7865fb738a59507e915da5eb67abd37bd0c","user":{"login":"exercism","id":5624255,"avatar_url":"https://avatars0.githubusercontent.com/u/5624255?v=4","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"repo":{"id":17273223,"name":"go","full_name":"exercism/go","owner":{"login":"exercism","id":5624255,"avatar_url":"https://avatars0.githubusercontent.com/u/5624255?v=4","gravatar_id":"","url":"https://api.github.com/users/exercism","html_url":"https://github.com/exercism","followers_url":"https://api.github.com/users/exercism/followers","following_url":"https://api.github.com/users/exercism/following{/other_user}","gists_url":"https://api.github.com/users/exercism/gists{/gist_id}","starred_url":"https://api.github.com/users/exercism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exercism/subscriptions","organizations_url":"https://api.github.com/users/exercism/orgs","repos_url":"https://api.github.com/users/exercism/repos","events_url":"https://api.github.com/users/exercism/events{/privacy}","received_events_url":"https://api.github.com/users/exercism/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exercism/go","description":"Exercism exercises in Go.","fork":false,"url":"https://api.github.com/repos/exercism/go","forks_url":"https://api.github.com/repos/exercism/go/forks","keys_url":"https://api.github.com/repos/exercism/go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exercism/go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exercism/go/teams","hooks_url":"https://api.github.com/repos/exercism/go/hooks","issue_events_url":"https://api.github.com/repos/exercism/go/issues/events{/number}","events_url":"https://api.github.com/repos/exercism/go/events","assignees_url":"https://api.github.com/repos/exercism/go/assignees{/user}","branches_url":"https://api.github.com/repos/exercism/go/branches{/branch}","tags_url":"https://api.github.com/repos/exercism/go/tags","blobs_url":"https://api.github.com/repos/exercism/go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exercism/go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exercism/go/git/refs{/sha}","trees_url":"https://api.github.com/repos/exercism/go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exercism/go/statuses/{sha}","languages_url":"https://api.github.com/repos/exercism/go/languages","stargazers_url":"https://api.github.com/repos/exercism/go/stargazers","contributors_url":"https://api.github.com/repos/exercism/go/contributors","subscribers_url":"https://api.github.com/repos/exercism/go/subscribers","subscription_url":"https://api.github.com/repos/exercism/go/subscription","commits_url":"https://api.github.com/repos/exercism/go/commits{/sha}","git_commits_url":"https://api.github.com/repos/exercism/go/git/commits{/sha}","comments_url":"https://api.github.com/repos/exercism/go/comments{/number}","issue_comment_url":"https://api.github.com/repos/exercism/go/issues/comments{/number}","contents_url":"https://api.github.com/repos/exercism/go/contents/{+path}","compare_url":"https://api.github.com/repos/exercism/go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exercism/go/merges","archive_url":"https://api.github.com/repos/exercism/go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exercism/go/downloads","issues_url":"https://api.github.com/repos/exercism/go/issues{/number}","pulls_url":"https://api.github.com/repos/exercism/go/pulls{/number}","milestones_url":"https://api.github.com/repos/exercism/go/milestones{/number}","notifications_url":"https://api.github.com/repos/exercism/go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exercism/go/labels{/name}","releases_url":"https://api.github.com/repos/exercism/go/releases{/id}","deployments_url":"https://api.github.com/repos/exercism/go/deployments","created_at":"2014-02-28T02:51:19Z","updated_at":"2018-04-30T08:16:49Z","pushed_at":"2018-04-19T08:41:04Z","git_url":"git://github.com/exercism/go.git","ssh_url":"git@github.com:exercism/go.git","clone_url":"https://github.com/exercism/go.git","svn_url":"https://github.com/exercism/go","homepage":"http://exercism.io/languages/go","size":2490,"stargazers_count":266,"watchers_count":266,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":163,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":163,"open_issues":27,"watchers":266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/exercism/go/pulls/1103"},"html":{"href":"https://github.com/exercism/go/pull/1103"},"issue":{"href":"https://api.github.com/repos/exercism/go/issues/1103"},"comments":{"href":"https://api.github.com/repos/exercism/go/issues/1103/comments"},"review_comments":{"href":"https://api.github.com/repos/exercism/go/pulls/1103/comments"},"review_comment":{"href":"https://api.github.com/repos/exercism/go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exercism/go/pulls/1103/commits"},"statuses":{"href":"https://api.github.com/repos/exercism/go/statuses/68860b93d063002bf0fe7b0af927cf56bdbc416d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"leenipper"}}