{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments/56524481","id":56524481,"diff_hunk":"@@ -97,7 +79,7 @@\n          *\n          * @param {string} formatString The string to be interpolated.\n          * @param {Object} parameters An optional set of parameters to the template.\n-         * @returns {HtmlSnippet} The resulting safely escaped HTML snippet.\n+         * @returns {string} The resulting safely escaped HTML snippet.","path":"src/js/utils/html-utils.js","position":80,"original_position":80,"commit_id":"809c27c5be4708bd35658f5faaabdc25096fe475","original_commit_id":"679c6f39d04a352dc658c5b3db7e61b50337abaa","user":{"login":"robrap","id":14576445,"avatar_url":"https://avatars.githubusercontent.com/u/14576445?v=3","gravatar_id":"","url":"https://api.github.com/users/robrap","html_url":"https://github.com/robrap","followers_url":"https://api.github.com/users/robrap/followers","following_url":"https://api.github.com/users/robrap/following{/other_user}","gists_url":"https://api.github.com/users/robrap/gists{/gist_id}","starred_url":"https://api.github.com/users/robrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robrap/subscriptions","organizations_url":"https://api.github.com/users/robrap/orgs","repos_url":"https://api.github.com/users/robrap/repos","events_url":"https://api.github.com/users/robrap/events{/privacy}","received_events_url":"https://api.github.com/users/robrap/received_events","type":"User","site_admin":false},"body":"Do you want to define somewhere that an \"HTML snippet\" is a \"string flagged as an HTML snippet\"?  Or, would it be better to consistently use the latter through all comments?\r\nFor example:\r\nThe resulting safely escaped string flagged as an HTML snippet.","created_at":"2016-03-17T15:36:21Z","updated_at":"2016-03-17T15:36:21Z","html_url":"https://github.com/edx/edx-ui-toolkit/pull/34#discussion_r56524481","pull_request_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments/56524481"},"html":{"href":"https://github.com/edx/edx-ui-toolkit/pull/34#discussion_r56524481"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34","id":63084022,"html_url":"https://github.com/edx/edx-ui-toolkit/pull/34","diff_url":"https://github.com/edx/edx-ui-toolkit/pull/34.diff","patch_url":"https://github.com/edx/edx-ui-toolkit/pull/34.patch","issue_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/34","number":34,"state":"open","locked":false,"title":"Improve HTML snippet handling for edx-platform","user":{"login":"andy-armstrong","id":5985072,"avatar_url":"https://avatars.githubusercontent.com/u/5985072?v=3","gravatar_id":"","url":"https://api.github.com/users/andy-armstrong","html_url":"https://github.com/andy-armstrong","followers_url":"https://api.github.com/users/andy-armstrong/followers","following_url":"https://api.github.com/users/andy-armstrong/following{/other_user}","gists_url":"https://api.github.com/users/andy-armstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-armstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-armstrong/subscriptions","organizations_url":"https://api.github.com/users/andy-armstrong/orgs","repos_url":"https://api.github.com/users/andy-armstrong/repos","events_url":"https://api.github.com/users/andy-armstrong/events{/privacy}","received_events_url":"https://api.github.com/users/andy-armstrong/received_events","type":"User","site_admin":false},"body":"It turns out that JQuery doesn't call ``toString`` on objects passed to its methods, so our approach of wrapping an HTML string in an object didn't work. At @robrap's suggestion, I'm now creating a string object and setting an ``isHtmlSnippet`` attribute on it. Fortunately almost all of the tests just worked with this fix, and even better you don't need to call ``toString`` before comparing the results.\r\n\r\nIn addition, I've removed a relative dependency from ``HtmlUtils`` to ``StringUtils`` as that doesn't currently work in edx-platform's Jasmine tests (I'm hoping it will work once we switch to Karma). In order to do this, I've changed the Jasmine tests to proxy dependency paths starting with ``edx-ui-toolkit`` to the correct location.\r\n\r\nI'm successfully using these changes in my PR to incorporate the UI Toolkit into the platform:\r\n\r\nhttps://github.com/edx/edx-platform/pull/11799\r\n\r\n@robrap @dan-f please review.\r\n\r\nFYI @AlasdairSwan @bjacobel ","created_at":"2016-03-16T15:29:50Z","updated_at":"2016-03-17T15:36:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e03b3b6f5b71e353b769d6fdbab7abc2c1aea1df","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34/commits","review_comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34/comments","review_comment_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/34/comments","statuses_url":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/809c27c5be4708bd35658f5faaabdc25096fe475","head":{"label":"edx:andya/remove-relative-paths","ref":"andya/remove-relative-paths","sha":"809c27c5be4708bd35658f5faaabdc25096fe475","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":40644985,"name":"edx-ui-toolkit","full_name":"edx/edx-ui-toolkit","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-ui-toolkit","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-ui-toolkit","forks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/forks","keys_url":"https://api.github.com/repos/edx/edx-ui-toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-ui-toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-ui-toolkit/teams","hooks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/events","assignees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-ui-toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/tags","blobs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-ui-toolkit/languages","stargazers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscription","commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-ui-toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-ui-toolkit/merges","archive_url":"https://api.github.com/repos/edx/edx-ui-toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-ui-toolkit/downloads","issues_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-ui-toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-ui-toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-ui-toolkit/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-ui-toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/deployments","created_at":"2015-08-13T07:28:13Z","updated_at":"2016-01-12T15:58:23Z","pushed_at":"2016-03-17T15:21:57Z","git_url":"git://github.com/edx/edx-ui-toolkit.git","ssh_url":"git@github.com:edx/edx-ui-toolkit.git","clone_url":"https://github.com/edx/edx-ui-toolkit.git","svn_url":"https://github.com/edx/edx-ui-toolkit","homepage":null,"size":100,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":4,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"b0c9b0ff0f5f8a24d78d327d445f3431f2138146","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":40644985,"name":"edx-ui-toolkit","full_name":"edx/edx-ui-toolkit","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-ui-toolkit","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-ui-toolkit","forks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/forks","keys_url":"https://api.github.com/repos/edx/edx-ui-toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-ui-toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-ui-toolkit/teams","hooks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/events","assignees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-ui-toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/tags","blobs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-ui-toolkit/languages","stargazers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscription","commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-ui-toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-ui-toolkit/merges","archive_url":"https://api.github.com/repos/edx/edx-ui-toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-ui-toolkit/downloads","issues_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-ui-toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-ui-toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-ui-toolkit/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-ui-toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/deployments","created_at":"2015-08-13T07:28:13Z","updated_at":"2016-01-12T15:58:23Z","pushed_at":"2016-03-17T15:21:57Z","git_url":"git://github.com/edx/edx-ui-toolkit.git","ssh_url":"git@github.com:edx/edx-ui-toolkit.git","clone_url":"https://github.com/edx/edx-ui-toolkit.git","svn_url":"https://github.com/edx/edx-ui-toolkit","homepage":null,"size":100,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34"},"html":{"href":"https://github.com/edx/edx-ui-toolkit/pull/34"},"issue":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/34"},"comments":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/809c27c5be4708bd35658f5faaabdc25096fe475"}}}}