{"action":"created","comment":{"url":"https://api.github.com/repos/dae/anki/pulls/comments/50760247","id":50760247,"diff_hunk":"@@ -34,6 +35,10 @@ def get_or_attr(obj, name, default=None):\n             return default\n \n \n+def removeClozeSound(txt):\n+    return re.sub(clozeSoundReg, \"\\\\1\\\\3\", txt)","path":"anki/template/template.py","position":13,"original_position":13,"commit_id":"9d1595b09fc84ddcc86824798d5b5544ec876e27","original_commit_id":"9d1595b09fc84ddcc86824798d5b5544ec876e27","user":{"login":"julienbaley","id":1148155,"avatar_url":"https://avatars.githubusercontent.com/u/1148155?v=3","gravatar_id":"","url":"https://api.github.com/users/julienbaley","html_url":"https://github.com/julienbaley","followers_url":"https://api.github.com/users/julienbaley/followers","following_url":"https://api.github.com/users/julienbaley/following{/other_user}","gists_url":"https://api.github.com/users/julienbaley/gists{/gist_id}","starred_url":"https://api.github.com/users/julienbaley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienbaley/subscriptions","organizations_url":"https://api.github.com/users/julienbaley/orgs","repos_url":"https://api.github.com/users/julienbaley/repos","events_url":"https://api.github.com/users/julienbaley/events{/privacy}","received_events_url":"https://api.github.com/users/julienbaley/received_events","type":"User","site_admin":false},"body":"The regex is unnecessarily capturing stuff.\r\n```python\r\nclozeSoundReg = r(\\[sound:.*\\])\"\r\ndef removeClozeSound(txt):\r\n    return re.sub(clozeSoundReg, \"\", txt)\r\n```","created_at":"2016-01-25T21:38:33Z","updated_at":"2016-01-25T21:38:33Z","html_url":"https://github.com/dae/anki/pull/116#discussion_r50760247","pull_request_url":"https://api.github.com/repos/dae/anki/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/dae/anki/pulls/comments/50760247"},"html":{"href":"https://github.com/dae/anki/pull/116#discussion_r50760247"},"pull_request":{"href":"https://api.github.com/repos/dae/anki/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/dae/anki/pulls/116","id":57133588,"html_url":"https://github.com/dae/anki/pull/116","diff_url":"https://github.com/dae/anki/pull/116.diff","patch_url":"https://github.com/dae/anki/pull/116.patch","issue_url":"https://api.github.com/repos/dae/anki/issues/116","number":116,"state":"open","locked":false,"title":"Only allow sound in active cloze deletions.","user":{"login":"EricGebhart","id":3607474,"avatar_url":"https://avatars.githubusercontent.com/u/3607474?v=3","gravatar_id":"","url":"https://api.github.com/users/EricGebhart","html_url":"https://github.com/EricGebhart","followers_url":"https://api.github.com/users/EricGebhart/followers","following_url":"https://api.github.com/users/EricGebhart/following{/other_user}","gists_url":"https://api.github.com/users/EricGebhart/gists{/gist_id}","starred_url":"https://api.github.com/users/EricGebhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricGebhart/subscriptions","organizations_url":"https://api.github.com/users/EricGebhart/orgs","repos_url":"https://api.github.com/users/EricGebhart/repos","events_url":"https://api.github.com/users/EricGebhart/events{/privacy}","received_events_url":"https://api.github.com/users/EricGebhart/received_events","type":"User","site_admin":false},"body":"This simple change allows for multi cloze deletion notes to have sound in a useful way.\r\nWhen the card is rendered [sound: ...] tags are removed from all clozes that are not active.\r\n\r\nThe [sound: ...] can be in the text and/or the hint.  It works properly for both cases.  There is\r\nno need for text to be present with in the cloze. A hint of just [sound:....] will display as [...] as usual.\r\n\r\nWith this change when a multi cloze card is created, [sound:] can be placed on all the clozes,\r\nbut only the sound for the active cloze on the current card will be played in preview.\r\n\r\n","created_at":"2016-01-25T21:30:58Z","updated_at":"2016-01-25T21:38:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b4cab0428331f3d91a74f912d762902f26799e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dae/anki/pulls/116/commits","review_comments_url":"https://api.github.com/repos/dae/anki/pulls/116/comments","review_comment_url":"https://api.github.com/repos/dae/anki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dae/anki/issues/116/comments","statuses_url":"https://api.github.com/repos/dae/anki/statuses/9d1595b09fc84ddcc86824798d5b5544ec876e27","head":{"label":"EricGebhart:master","ref":"master","sha":"9d1595b09fc84ddcc86824798d5b5544ec876e27","user":{"login":"EricGebhart","id":3607474,"avatar_url":"https://avatars.githubusercontent.com/u/3607474?v=3","gravatar_id":"","url":"https://api.github.com/users/EricGebhart","html_url":"https://github.com/EricGebhart","followers_url":"https://api.github.com/users/EricGebhart/followers","following_url":"https://api.github.com/users/EricGebhart/following{/other_user}","gists_url":"https://api.github.com/users/EricGebhart/gists{/gist_id}","starred_url":"https://api.github.com/users/EricGebhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricGebhart/subscriptions","organizations_url":"https://api.github.com/users/EricGebhart/orgs","repos_url":"https://api.github.com/users/EricGebhart/repos","events_url":"https://api.github.com/users/EricGebhart/events{/privacy}","received_events_url":"https://api.github.com/users/EricGebhart/received_events","type":"User","site_admin":false},"repo":{"id":50363633,"name":"anki","full_name":"EricGebhart/anki","owner":{"login":"EricGebhart","id":3607474,"avatar_url":"https://avatars.githubusercontent.com/u/3607474?v=3","gravatar_id":"","url":"https://api.github.com/users/EricGebhart","html_url":"https://github.com/EricGebhart","followers_url":"https://api.github.com/users/EricGebhart/followers","following_url":"https://api.github.com/users/EricGebhart/following{/other_user}","gists_url":"https://api.github.com/users/EricGebhart/gists{/gist_id}","starred_url":"https://api.github.com/users/EricGebhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricGebhart/subscriptions","organizations_url":"https://api.github.com/users/EricGebhart/orgs","repos_url":"https://api.github.com/users/EricGebhart/repos","events_url":"https://api.github.com/users/EricGebhart/events{/privacy}","received_events_url":"https://api.github.com/users/EricGebhart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EricGebhart/anki","description":"Anki for desktop computers","fork":true,"url":"https://api.github.com/repos/EricGebhart/anki","forks_url":"https://api.github.com/repos/EricGebhart/anki/forks","keys_url":"https://api.github.com/repos/EricGebhart/anki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EricGebhart/anki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EricGebhart/anki/teams","hooks_url":"https://api.github.com/repos/EricGebhart/anki/hooks","issue_events_url":"https://api.github.com/repos/EricGebhart/anki/issues/events{/number}","events_url":"https://api.github.com/repos/EricGebhart/anki/events","assignees_url":"https://api.github.com/repos/EricGebhart/anki/assignees{/user}","branches_url":"https://api.github.com/repos/EricGebhart/anki/branches{/branch}","tags_url":"https://api.github.com/repos/EricGebhart/anki/tags","blobs_url":"https://api.github.com/repos/EricGebhart/anki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EricGebhart/anki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EricGebhart/anki/git/refs{/sha}","trees_url":"https://api.github.com/repos/EricGebhart/anki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EricGebhart/anki/statuses/{sha}","languages_url":"https://api.github.com/repos/EricGebhart/anki/languages","stargazers_url":"https://api.github.com/repos/EricGebhart/anki/stargazers","contributors_url":"https://api.github.com/repos/EricGebhart/anki/contributors","subscribers_url":"https://api.github.com/repos/EricGebhart/anki/subscribers","subscription_url":"https://api.github.com/repos/EricGebhart/anki/subscription","commits_url":"https://api.github.com/repos/EricGebhart/anki/commits{/sha}","git_commits_url":"https://api.github.com/repos/EricGebhart/anki/git/commits{/sha}","comments_url":"https://api.github.com/repos/EricGebhart/anki/comments{/number}","issue_comment_url":"https://api.github.com/repos/EricGebhart/anki/issues/comments{/number}","contents_url":"https://api.github.com/repos/EricGebhart/anki/contents/{+path}","compare_url":"https://api.github.com/repos/EricGebhart/anki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EricGebhart/anki/merges","archive_url":"https://api.github.com/repos/EricGebhart/anki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EricGebhart/anki/downloads","issues_url":"https://api.github.com/repos/EricGebhart/anki/issues{/number}","pulls_url":"https://api.github.com/repos/EricGebhart/anki/pulls{/number}","milestones_url":"https://api.github.com/repos/EricGebhart/anki/milestones{/number}","notifications_url":"https://api.github.com/repos/EricGebhart/anki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EricGebhart/anki/labels{/name}","releases_url":"https://api.github.com/repos/EricGebhart/anki/releases{/id}","deployments_url":"https://api.github.com/repos/EricGebhart/anki/deployments","created_at":"2016-01-25T16:21:41Z","updated_at":"2016-01-25T16:21:42Z","pushed_at":"2016-01-25T21:18:28Z","git_url":"git://github.com/EricGebhart/anki.git","ssh_url":"git@github.com:EricGebhart/anki.git","clone_url":"https://github.com/EricGebhart/anki.git","svn_url":"https://github.com/EricGebhart/anki","homepage":null,"size":2034,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"dae:master","ref":"master","sha":"965b3055a9bcdbadfc7df8656b81af90d8fcb5a5","user":{"login":"dae","id":180542,"avatar_url":"https://avatars.githubusercontent.com/u/180542?v=3","gravatar_id":"","url":"https://api.github.com/users/dae","html_url":"https://github.com/dae","followers_url":"https://api.github.com/users/dae/followers","following_url":"https://api.github.com/users/dae/following{/other_user}","gists_url":"https://api.github.com/users/dae/gists{/gist_id}","starred_url":"https://api.github.com/users/dae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dae/subscriptions","organizations_url":"https://api.github.com/users/dae/orgs","repos_url":"https://api.github.com/users/dae/repos","events_url":"https://api.github.com/users/dae/events{/privacy}","received_events_url":"https://api.github.com/users/dae/received_events","type":"User","site_admin":false},"repo":{"id":7270538,"name":"anki","full_name":"dae/anki","owner":{"login":"dae","id":180542,"avatar_url":"https://avatars.githubusercontent.com/u/180542?v=3","gravatar_id":"","url":"https://api.github.com/users/dae","html_url":"https://github.com/dae","followers_url":"https://api.github.com/users/dae/followers","following_url":"https://api.github.com/users/dae/following{/other_user}","gists_url":"https://api.github.com/users/dae/gists{/gist_id}","starred_url":"https://api.github.com/users/dae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dae/subscriptions","organizations_url":"https://api.github.com/users/dae/orgs","repos_url":"https://api.github.com/users/dae/repos","events_url":"https://api.github.com/users/dae/events{/privacy}","received_events_url":"https://api.github.com/users/dae/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dae/anki","description":"Anki for desktop computers","fork":false,"url":"https://api.github.com/repos/dae/anki","forks_url":"https://api.github.com/repos/dae/anki/forks","keys_url":"https://api.github.com/repos/dae/anki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dae/anki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dae/anki/teams","hooks_url":"https://api.github.com/repos/dae/anki/hooks","issue_events_url":"https://api.github.com/repos/dae/anki/issues/events{/number}","events_url":"https://api.github.com/repos/dae/anki/events","assignees_url":"https://api.github.com/repos/dae/anki/assignees{/user}","branches_url":"https://api.github.com/repos/dae/anki/branches{/branch}","tags_url":"https://api.github.com/repos/dae/anki/tags","blobs_url":"https://api.github.com/repos/dae/anki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dae/anki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dae/anki/git/refs{/sha}","trees_url":"https://api.github.com/repos/dae/anki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dae/anki/statuses/{sha}","languages_url":"https://api.github.com/repos/dae/anki/languages","stargazers_url":"https://api.github.com/repos/dae/anki/stargazers","contributors_url":"https://api.github.com/repos/dae/anki/contributors","subscribers_url":"https://api.github.com/repos/dae/anki/subscribers","subscription_url":"https://api.github.com/repos/dae/anki/subscription","commits_url":"https://api.github.com/repos/dae/anki/commits{/sha}","git_commits_url":"https://api.github.com/repos/dae/anki/git/commits{/sha}","comments_url":"https://api.github.com/repos/dae/anki/comments{/number}","issue_comment_url":"https://api.github.com/repos/dae/anki/issues/comments{/number}","contents_url":"https://api.github.com/repos/dae/anki/contents/{+path}","compare_url":"https://api.github.com/repos/dae/anki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dae/anki/merges","archive_url":"https://api.github.com/repos/dae/anki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dae/anki/downloads","issues_url":"https://api.github.com/repos/dae/anki/issues{/number}","pulls_url":"https://api.github.com/repos/dae/anki/pulls{/number}","milestones_url":"https://api.github.com/repos/dae/anki/milestones{/number}","notifications_url":"https://api.github.com/repos/dae/anki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dae/anki/labels{/name}","releases_url":"https://api.github.com/repos/dae/anki/releases{/id}","deployments_url":"https://api.github.com/repos/dae/anki/deployments","created_at":"2012-12-21T08:03:31Z","updated_at":"2016-01-25T17:35:33Z","pushed_at":"2016-01-25T21:30:58Z","git_url":"git://github.com/dae/anki.git","ssh_url":"git@github.com:dae/anki.git","clone_url":"https://github.com/dae/anki.git","svn_url":"https://github.com/dae/anki","homepage":null,"size":2957,"stargazers_count":1337,"watchers_count":1337,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":318,"mirror_url":null,"open_issues_count":12,"forks":318,"open_issues":12,"watchers":1337,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dae/anki/pulls/116"},"html":{"href":"https://github.com/dae/anki/pull/116"},"issue":{"href":"https://api.github.com/repos/dae/anki/issues/116"},"comments":{"href":"https://api.github.com/repos/dae/anki/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/dae/anki/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/dae/anki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dae/anki/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/dae/anki/statuses/9d1595b09fc84ddcc86824798d5b5544ec876e27"}}}}