GitHub PullRequestReviewCommentEvent at 2014-12-21 22:46:45
Repository: balance-text
Actor: redmunds
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/comments/22151011","id":22151011,"diff_hunk":"@@ -99,10 +99,18 @@\n     };\n \n     /**\n-     * Returns true iff c is an HTML space character.\n+     * Returns true iff c is a space character outside of HTML < > tags.\n      */\n-    var isWS = function (c) {\n-        return Boolean(c.match(/^\\s$/));\n+    var isWS = function (txt, index) {\n+        var re = /\\s(?![^<]*>)/g,","path":"jquery.balancetext.js","position":10,"original_position":10,"commit_id":"7f864bf0e1e7bdbe5a516fb515ebc0b09c8db1ee","original_commit_id":"7f864bf0e1e7bdbe5a516fb515ebc0b09c8db1ee","user":{"login":"redmunds","id":1197144,"avatar_url":"https://avatars.githubusercontent.com/u/1197144?v=3","gravatar_id":"","url":"https://api.github.com/users/redmunds","html_url":"https://github.com/redmunds","followers_url":"https://api.github.com/users/redmunds/followers","following_url":"https://api.github.com/users/redmunds/following{/other_user}","gists_url":"https://api.github.com/users/redmunds/gists{/gist_id}","starred_url":"https://api.github.com/users/redmunds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redmunds/subscriptions","organizations_url":"https://api.github.com/users/redmunds/orgs","repos_url":"https://api.github.com/users/redmunds/repos","events_url":"https://api.github.com/users/redmunds/events{/privacy}","received_events_url":"https://api.github.com/users/redmunds/received_events","type":"User","site_admin":false},"body":"@rileyjshaw Since this regex is used with `exec()` method in a loop (i.e. subsequent calls start where previous result ends) the this doesn't need `g` flag, right?","created_at":"2014-12-21T22:46:45Z","updated_at":"2014-12-21T22:46:45Z","html_url":"https://github.com/adobe-webplatform/balance-text/pull/46#discussion_r22151011","pull_request_url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/comments/22151011"},"html":{"href":"https://github.com/adobe-webplatform/balance-text/pull/46#discussion_r22151011"},"pull_request":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46","id":24895393,"html_url":"https://github.com/adobe-webplatform/balance-text/pull/46","diff_url":"https://github.com/adobe-webplatform/balance-text/pull/46.diff","patch_url":"https://github.com/adobe-webplatform/balance-text/pull/46.patch","issue_url":"https://api.github.com/repos/adobe-webplatform/balance-text/issues/46","number":46,"state":"open","locked":false,"title":"Fix #26: allow nested elements","user":{"login":"rileyjshaw","id":1840854,"avatar_url":"https://avatars.githubusercontent.com/u/1840854?v=3","gravatar_id":"","url":"https://api.github.com/users/rileyjshaw","html_url":"https://github.com/rileyjshaw","followers_url":"https://api.github.com/users/rileyjshaw/followers","following_url":"https://api.github.com/users/rileyjshaw/following{/other_user}","gists_url":"https://api.github.com/users/rileyjshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/rileyjshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileyjshaw/subscriptions","organizations_url":"https://api.github.com/users/rileyjshaw/orgs","repos_url":"https://api.github.com/users/rileyjshaw/repos","events_url":"https://api.github.com/users/rileyjshaw/events{/privacy}","received_events_url":"https://api.github.com/users/rileyjshaw/received_events","type":"User","site_admin":false},"body":"Change the regexp in `isWS()` to only match space characters outside of element tags. The space in `<div class=\"foo\">` is not matched, but the spaces in `<div>This is inner content</div>` are matched.\r\n\r\nTo make this more efficient, potential breakpoint indices could be held in an array outside of isWS.\r\n\r\nA working demo can be seen [here](http://codepen.io/rileyjshaw/pen/oggBxz).","created_at":"2014-11-23T00:00:55Z","updated_at":"2014-12-21T22:46:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85ef27e61a530989235e9898bf28f1cd5983e4a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46/commits","review_comments_url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46/comments","review_comment_url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/comments/{number}","comments_url":"https://api.github.com/repos/adobe-webplatform/balance-text/issues/46/comments","statuses_url":"https://api.github.com/repos/adobe-webplatform/balance-text/statuses/7f864bf0e1e7bdbe5a516fb515ebc0b09c8db1ee","head":{"label":"rileyjshaw:nested-tags","ref":"nested-tags","sha":"7f864bf0e1e7bdbe5a516fb515ebc0b09c8db1ee","user":{"login":"rileyjshaw","id":1840854,"avatar_url":"https://avatars.githubusercontent.com/u/1840854?v=3","gravatar_id":"","url":"https://api.github.com/users/rileyjshaw","html_url":"https://github.com/rileyjshaw","followers_url":"https://api.github.com/users/rileyjshaw/followers","following_url":"https://api.github.com/users/rileyjshaw/following{/other_user}","gists_url":"https://api.github.com/users/rileyjshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/rileyjshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileyjshaw/subscriptions","organizations_url":"https://api.github.com/users/rileyjshaw/orgs","repos_url":"https://api.github.com/users/rileyjshaw/repos","events_url":"https://api.github.com/users/rileyjshaw/events{/privacy}","received_events_url":"https://api.github.com/users/rileyjshaw/received_events","type":"User","site_admin":false},"repo":{"id":26869186,"name":"balance-text","full_name":"rileyjshaw/balance-text","owner":{"login":"rileyjshaw","id":1840854,"avatar_url":"https://avatars.githubusercontent.com/u/1840854?v=3","gravatar_id":"","url":"https://api.github.com/users/rileyjshaw","html_url":"https://github.com/rileyjshaw","followers_url":"https://api.github.com/users/rileyjshaw/followers","following_url":"https://api.github.com/users/rileyjshaw/following{/other_user}","gists_url":"https://api.github.com/users/rileyjshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/rileyjshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileyjshaw/subscriptions","organizations_url":"https://api.github.com/users/rileyjshaw/orgs","repos_url":"https://api.github.com/users/rileyjshaw/repos","events_url":"https://api.github.com/users/rileyjshaw/events{/privacy}","received_events_url":"https://api.github.com/users/rileyjshaw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rileyjshaw/balance-text","description":"A jQuery plugin for implementing balancing of wrapping text in a web page","fork":true,"url":"https://api.github.com/repos/rileyjshaw/balance-text","forks_url":"https://api.github.com/repos/rileyjshaw/balance-text/forks","keys_url":"https://api.github.com/repos/rileyjshaw/balance-text/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rileyjshaw/balance-text/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rileyjshaw/balance-text/teams","hooks_url":"https://api.github.com/repos/rileyjshaw/balance-text/hooks","issue_events_url":"https://api.github.com/repos/rileyjshaw/balance-text/issues/events{/number}","events_url":"https://api.github.com/repos/rileyjshaw/balance-text/events","assignees_url":"https://api.github.com/repos/rileyjshaw/balance-text/assignees{/user}","branches_url":"https://api.github.com/repos/rileyjshaw/balance-text/branches{/branch}","tags_url":"https://api.github.com/repos/rileyjshaw/balance-text/tags","blobs_url":"https://api.github.com/repos/rileyjshaw/balance-text/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rileyjshaw/balance-text/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rileyjshaw/balance-text/git/refs{/sha}","trees_url":"https://api.github.com/repos/rileyjshaw/balance-text/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rileyjshaw/balance-text/statuses/{sha}","languages_url":"https://api.github.com/repos/rileyjshaw/balance-text/languages","stargazers_url":"https://api.github.com/repos/rileyjshaw/balance-text/stargazers","contributors_url":"https://api.github.com/repos/rileyjshaw/balance-text/contributors","subscribers_url":"https://api.github.com/repos/rileyjshaw/balance-text/subscribers","subscription_url":"https://api.github.com/repos/rileyjshaw/balance-text/subscription","commits_url":"https://api.github.com/repos/rileyjshaw/balance-text/commits{/sha}","git_commits_url":"https://api.github.com/repos/rileyjshaw/balance-text/git/commits{/sha}","comments_url":"https://api.github.com/repos/rileyjshaw/balance-text/comments{/number}","issue_comment_url":"https://api.github.com/repos/rileyjshaw/balance-text/issues/comments/{number}","contents_url":"https://api.github.com/repos/rileyjshaw/balance-text/contents/{+path}","compare_url":"https://api.github.com/repos/rileyjshaw/balance-text/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rileyjshaw/balance-text/merges","archive_url":"https://api.github.com/repos/rileyjshaw/balance-text/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rileyjshaw/balance-text/downloads","issues_url":"https://api.github.com/repos/rileyjshaw/balance-text/issues{/number}","pulls_url":"https://api.github.com/repos/rileyjshaw/balance-text/pulls{/number}","milestones_url":"https://api.github.com/repos/rileyjshaw/balance-text/milestones{/number}","notifications_url":"https://api.github.com/repos/rileyjshaw/balance-text/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rileyjshaw/balance-text/labels{/name}","releases_url":"https://api.github.com/repos/rileyjshaw/balance-text/releases{/id}","created_at":"2014-11-19T16:02:42Z","updated_at":"2014-11-19T16:02:44Z","pushed_at":"2014-12-13T19:57:34Z","git_url":"git://github.com/rileyjshaw/balance-text.git","ssh_url":"git@github.com:rileyjshaw/balance-text.git","clone_url":"https://github.com/rileyjshaw/balance-text.git","svn_url":"https://github.com/rileyjshaw/balance-text","homepage":null,"size":635,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"adobe-webplatform:master","ref":"master","sha":"978b4721299c52620b9adb5727d56b13f76889c7","user":{"login":"adobe-webplatform","id":2976699,"avatar_url":"https://avatars.githubusercontent.com/u/2976699?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe-webplatform","html_url":"https://github.com/adobe-webplatform","followers_url":"https://api.github.com/users/adobe-webplatform/followers","following_url":"https://api.github.com/users/adobe-webplatform/following{/other_user}","gists_url":"https://api.github.com/users/adobe-webplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe-webplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe-webplatform/subscriptions","organizations_url":"https://api.github.com/users/adobe-webplatform/orgs","repos_url":"https://api.github.com/users/adobe-webplatform/repos","events_url":"https://api.github.com/users/adobe-webplatform/events{/privacy}","received_events_url":"https://api.github.com/users/adobe-webplatform/received_events","type":"Organization","site_admin":false},"repo":{"id":7567904,"name":"balance-text","full_name":"adobe-webplatform/balance-text","owner":{"login":"adobe-webplatform","id":2976699,"avatar_url":"https://avatars.githubusercontent.com/u/2976699?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe-webplatform","html_url":"https://github.com/adobe-webplatform","followers_url":"https://api.github.com/users/adobe-webplatform/followers","following_url":"https://api.github.com/users/adobe-webplatform/following{/other_user}","gists_url":"https://api.github.com/users/adobe-webplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe-webplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe-webplatform/subscriptions","organizations_url":"https://api.github.com/users/adobe-webplatform/orgs","repos_url":"https://api.github.com/users/adobe-webplatform/repos","events_url":"https://api.github.com/users/adobe-webplatform/events{/privacy}","received_events_url":"https://api.github.com/users/adobe-webplatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe-webplatform/balance-text","description":"A jQuery plugin for implementing balancing of wrapping text in a web page","fork":false,"url":"https://api.github.com/repos/adobe-webplatform/balance-text","forks_url":"https://api.github.com/repos/adobe-webplatform/balance-text/forks","keys_url":"https://api.github.com/repos/adobe-webplatform/balance-text/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe-webplatform/balance-text/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe-webplatform/balance-text/teams","hooks_url":"https://api.github.com/repos/adobe-webplatform/balance-text/hooks","issue_events_url":"https://api.github.com/repos/adobe-webplatform/balance-text/issues/events{/number}","events_url":"https://api.github.com/repos/adobe-webplatform/balance-text/events","assignees_url":"https://api.github.com/repos/adobe-webplatform/balance-text/assignees{/user}","branches_url":"https://api.github.com/repos/adobe-webplatform/balance-text/branches{/branch}","tags_url":"https://api.github.com/repos/adobe-webplatform/balance-text/tags","blobs_url":"https://api.github.com/repos/adobe-webplatform/balance-text/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe-webplatform/balance-text/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe-webplatform/balance-text/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe-webplatform/balance-text/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe-webplatform/balance-text/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe-webplatform/balance-text/languages","stargazers_url":"https://api.github.com/repos/adobe-webplatform/balance-text/stargazers","contributors_url":"https://api.github.com/repos/adobe-webplatform/balance-text/contributors","subscribers_url":"https://api.github.com/repos/adobe-webplatform/balance-text/subscribers","subscription_url":"https://api.github.com/repos/adobe-webplatform/balance-text/subscription","commits_url":"https://api.github.com/repos/adobe-webplatform/balance-text/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe-webplatform/balance-text/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe-webplatform/balance-text/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe-webplatform/balance-text/issues/comments/{number}","contents_url":"https://api.github.com/repos/adobe-webplatform/balance-text/contents/{+path}","compare_url":"https://api.github.com/repos/adobe-webplatform/balance-text/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe-webplatform/balance-text/merges","archive_url":"https://api.github.com/repos/adobe-webplatform/balance-text/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe-webplatform/balance-text/downloads","issues_url":"https://api.github.com/repos/adobe-webplatform/balance-text/issues{/number}","pulls_url":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe-webplatform/balance-text/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe-webplatform/balance-text/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe-webplatform/balance-text/labels{/name}","releases_url":"https://api.github.com/repos/adobe-webplatform/balance-text/releases{/id}","created_at":"2013-01-11T22:07:30Z","updated_at":"2014-12-17T13:53:10Z","pushed_at":"2014-04-28T15:30:38Z","git_url":"git://github.com/adobe-webplatform/balance-text.git","ssh_url":"git@github.com:adobe-webplatform/balance-text.git","clone_url":"https://github.com/adobe-webplatform/balance-text.git","svn_url":"https://github.com/adobe-webplatform/balance-text","homepage":null,"size":1079,"stargazers_count":676,"watchers_count":676,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":43,"mirror_url":null,"open_issues_count":5,"forks":43,"open_issues":5,"watchers":676,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46"},"html":{"href":"https://github.com/adobe-webplatform/balance-text/pull/46"},"issue":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/issues/46"},"comments":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/adobe-webplatform/balance-text/statuses/7f864bf0e1e7bdbe5a516fb515ebc0b09c8db1ee"}}}}