{"action":"created","comment":{"url":"https://api.github.com/repos/MarkBind/vue-strap/pulls/comments/193298643","pull_request_review_id":126240304,"id":193298643,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzI5ODY0Mw==","diff_hunk":"@@ -35,18 +40,52 @@ export default {\n             });\n           }\n         });\n-        if (!hasMatchingHeading) {\n-          if (regex.test(title) || regex.test(keywords)) {\n-            matches.push(entry);\n-          }\n-        }\n       });\n       return matches;\n     },\n   },\n   filters: {\n     highlight(value, phrase) {\n-      return value.replace(new RegExp(`(${phrase})`, 'gi'), '<mark>$1</mark>');\n+      function mergeOverlappingIntervals(intervals) {\n+        if (intervals.length <= 1) {\n+          return intervals;\n+        }\n+        const sortedIntervals = intervals.sort((a, b) => a.start - b.start);\n+        const stack = [sortedIntervals[0]];\n+        for (let i = 1; i < sortedIntervals.length; i += 1) {\n+          const top = stack[stack.length - 1];\n+          if (top.end < sortedIntervals[i].start) {\n+            stack.push(sortedIntervals[i]);\n+          } else if (top.end < sortedIntervals[i].end) {\n+            top.end = sortedIntervals[i].end;\n+          }\n+        }\n+        return stack;\n+      }\n+\n+      function collectMatchPos() {\n+        const keywords = phrase.split(' ').filter(keyword => keyword !== '');\n+        const matchPos = [];\n+        keywords.forEach((keyword) => {\n+          const regex = new RegExp(`(${keyword})`, 'gi');\n+          let match = regex.exec(value);\n+          while (match != null) {","path":"src/Searchbar.vue","position":63,"original_position":63,"commit_id":"141442abd7d7c29de8c15e6187277f98619c01ac","original_commit_id":"141442abd7d7c29de8c15e6187277f98619c01ac","user":{"login":"yamgent","id":3168908,"node_id":"MDQ6VXNlcjMxNjg5MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3168908?v=4","gravatar_id":"","url":"https://api.github.com/users/yamgent","html_url":"https://github.com/yamgent","followers_url":"https://api.github.com/users/yamgent/followers","following_url":"https://api.github.com/users/yamgent/following{/other_user}","gists_url":"https://api.github.com/users/yamgent/gists{/gist_id}","starred_url":"https://api.github.com/users/yamgent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamgent/subscriptions","organizations_url":"https://api.github.com/users/yamgent/orgs","repos_url":"https://api.github.com/users/yamgent/repos","events_url":"https://api.github.com/users/yamgent/events{/privacy}","received_events_url":"https://api.github.com/users/yamgent/received_events","type":"User","site_admin":false},"body":"`while (match !== null) {`\r\n\r\n(use `!==` instead of `!=`)","created_at":"2018-06-06T05:56:33Z","updated_at":"2018-06-06T06:02:34Z","html_url":"https://github.com/MarkBind/vue-strap/pull/32#discussion_r193298643","pull_request_url":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/MarkBind/vue-strap/pulls/comments/193298643"},"html":{"href":"https://github.com/MarkBind/vue-strap/pull/32#discussion_r193298643"},"pull_request":{"href":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32","id":192320718,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMzIwNzE4","html_url":"https://github.com/MarkBind/vue-strap/pull/32","diff_url":"https://github.com/MarkBind/vue-strap/pull/32.diff","patch_url":"https://github.com/MarkBind/vue-strap/pull/32.patch","issue_url":"https://api.github.com/repos/MarkBind/vue-strap/issues/32","number":32,"state":"open","locked":false,"title":"Support search by non-consecutive keywords","user":{"login":"nusjzx","id":24241939,"node_id":"MDQ6VXNlcjI0MjQxOTM5","avatar_url":"https://avatars2.githubusercontent.com/u/24241939?v=4","gravatar_id":"","url":"https://api.github.com/users/nusjzx","html_url":"https://github.com/nusjzx","followers_url":"https://api.github.com/users/nusjzx/followers","following_url":"https://api.github.com/users/nusjzx/following{/other_user}","gists_url":"https://api.github.com/users/nusjzx/gists{/gist_id}","starred_url":"https://api.github.com/users/nusjzx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nusjzx/subscriptions","organizations_url":"https://api.github.com/users/nusjzx/orgs","repos_url":"https://api.github.com/users/nusjzx/repos","events_url":"https://api.github.com/users/nusjzx/events{/privacy}","received_events_url":"https://api.github.com/users/nusjzx/received_events","type":"User","site_admin":false},"body":"What is the purpose of this pull request? (put \"X\" next to an item, remove the rest)\r\n\r\n• [ ] Documentation update\r\n• [X] Bug fix\r\n• [ ] New feature\r\n• [] Enhancement to an existing feature\r\n• [ ] Other, please explain:\r\n\r\nResolves https://github.com/MarkBind/markbind/issues/217\r\n\r\nWhat is the rationale for this request?\r\nwe shouldn't just pattern match the user input with the string. Instead, we should consider the user input as separate words, then match one by one.\r\n\r\nWhat changes did you make? (Give an overview)\r\nread in the user input as separate keywords, then match one by one.\r\nHighlight is also done for each keyword.\r\n\r\nTesting instructions:\r\n1.run `npm run docs`\r\n2.can try key in many keywords in different orders,  eg: \"k3 k1 k2\"","created_at":"2018-06-04T07:34:40Z","updated_at":"2018-06-06T06:02:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6bb87685a2a2ad41ba3df8f623883f11a0dd5a8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32/commits","review_comments_url":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32/comments","review_comment_url":"https://api.github.com/repos/MarkBind/vue-strap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MarkBind/vue-strap/issues/32/comments","statuses_url":"https://api.github.com/repos/MarkBind/vue-strap/statuses/141442abd7d7c29de8c15e6187277f98619c01ac","head":{"label":"nusjzx:217-Support-searching-by-non-consecutive-keywords","ref":"217-Support-searching-by-non-consecutive-keywords","sha":"141442abd7d7c29de8c15e6187277f98619c01ac","user":{"login":"nusjzx","id":24241939,"node_id":"MDQ6VXNlcjI0MjQxOTM5","avatar_url":"https://avatars2.githubusercontent.com/u/24241939?v=4","gravatar_id":"","url":"https://api.github.com/users/nusjzx","html_url":"https://github.com/nusjzx","followers_url":"https://api.github.com/users/nusjzx/followers","following_url":"https://api.github.com/users/nusjzx/following{/other_user}","gists_url":"https://api.github.com/users/nusjzx/gists{/gist_id}","starred_url":"https://api.github.com/users/nusjzx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nusjzx/subscriptions","organizations_url":"https://api.github.com/users/nusjzx/orgs","repos_url":"https://api.github.com/users/nusjzx/repos","events_url":"https://api.github.com/users/nusjzx/events{/privacy}","received_events_url":"https://api.github.com/users/nusjzx/received_events","type":"User","site_admin":false},"repo":{"id":133311478,"node_id":"MDEwOlJlcG9zaXRvcnkxMzMzMTE0Nzg=","name":"vue-strap","full_name":"nusjzx/vue-strap","owner":{"login":"nusjzx","id":24241939,"node_id":"MDQ6VXNlcjI0MjQxOTM5","avatar_url":"https://avatars2.githubusercontent.com/u/24241939?v=4","gravatar_id":"","url":"https://api.github.com/users/nusjzx","html_url":"https://github.com/nusjzx","followers_url":"https://api.github.com/users/nusjzx/followers","following_url":"https://api.github.com/users/nusjzx/following{/other_user}","gists_url":"https://api.github.com/users/nusjzx/gists{/gist_id}","starred_url":"https://api.github.com/users/nusjzx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nusjzx/subscriptions","organizations_url":"https://api.github.com/users/nusjzx/orgs","repos_url":"https://api.github.com/users/nusjzx/repos","events_url":"https://api.github.com/users/nusjzx/events{/privacy}","received_events_url":"https://api.github.com/users/nusjzx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nusjzx/vue-strap","description":"Bootstrap components built with Vue.js","fork":true,"url":"https://api.github.com/repos/nusjzx/vue-strap","forks_url":"https://api.github.com/repos/nusjzx/vue-strap/forks","keys_url":"https://api.github.com/repos/nusjzx/vue-strap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nusjzx/vue-strap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nusjzx/vue-strap/teams","hooks_url":"https://api.github.com/repos/nusjzx/vue-strap/hooks","issue_events_url":"https://api.github.com/repos/nusjzx/vue-strap/issues/events{/number}","events_url":"https://api.github.com/repos/nusjzx/vue-strap/events","assignees_url":"https://api.github.com/repos/nusjzx/vue-strap/assignees{/user}","branches_url":"https://api.github.com/repos/nusjzx/vue-strap/branches{/branch}","tags_url":"https://api.github.com/repos/nusjzx/vue-strap/tags","blobs_url":"https://api.github.com/repos/nusjzx/vue-strap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nusjzx/vue-strap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nusjzx/vue-strap/git/refs{/sha}","trees_url":"https://api.github.com/repos/nusjzx/vue-strap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nusjzx/vue-strap/statuses/{sha}","languages_url":"https://api.github.com/repos/nusjzx/vue-strap/languages","stargazers_url":"https://api.github.com/repos/nusjzx/vue-strap/stargazers","contributors_url":"https://api.github.com/repos/nusjzx/vue-strap/contributors","subscribers_url":"https://api.github.com/repos/nusjzx/vue-strap/subscribers","subscription_url":"https://api.github.com/repos/nusjzx/vue-strap/subscription","commits_url":"https://api.github.com/repos/nusjzx/vue-strap/commits{/sha}","git_commits_url":"https://api.github.com/repos/nusjzx/vue-strap/git/commits{/sha}","comments_url":"https://api.github.com/repos/nusjzx/vue-strap/comments{/number}","issue_comment_url":"https://api.github.com/repos/nusjzx/vue-strap/issues/comments{/number}","contents_url":"https://api.github.com/repos/nusjzx/vue-strap/contents/{+path}","compare_url":"https://api.github.com/repos/nusjzx/vue-strap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nusjzx/vue-strap/merges","archive_url":"https://api.github.com/repos/nusjzx/vue-strap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nusjzx/vue-strap/downloads","issues_url":"https://api.github.com/repos/nusjzx/vue-strap/issues{/number}","pulls_url":"https://api.github.com/repos/nusjzx/vue-strap/pulls{/number}","milestones_url":"https://api.github.com/repos/nusjzx/vue-strap/milestones{/number}","notifications_url":"https://api.github.com/repos/nusjzx/vue-strap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nusjzx/vue-strap/labels{/name}","releases_url":"https://api.github.com/repos/nusjzx/vue-strap/releases{/id}","deployments_url":"https://api.github.com/repos/nusjzx/vue-strap/deployments","created_at":"2018-05-14T05:57:22Z","updated_at":"2018-06-06T04:13:32Z","pushed_at":"2018-06-06T05:21:40Z","git_url":"git://github.com/nusjzx/vue-strap.git","ssh_url":"git@github.com:nusjzx/vue-strap.git","clone_url":"https://github.com/nusjzx/vue-strap.git","svn_url":"https://github.com/nusjzx/vue-strap","homepage":"http://MarkBind.github.io/vue-strap/","size":28385,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MarkBind:master","ref":"master","sha":"689d4bd6280a1011b072c4d750fc110bb8121cf5","user":{"login":"MarkBind","id":25006893,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDA2ODkz","avatar_url":"https://avatars1.githubusercontent.com/u/25006893?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkBind","html_url":"https://github.com/MarkBind","followers_url":"https://api.github.com/users/MarkBind/followers","following_url":"https://api.github.com/users/MarkBind/following{/other_user}","gists_url":"https://api.github.com/users/MarkBind/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkBind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkBind/subscriptions","organizations_url":"https://api.github.com/users/MarkBind/orgs","repos_url":"https://api.github.com/users/MarkBind/repos","events_url":"https://api.github.com/users/MarkBind/events{/privacy}","received_events_url":"https://api.github.com/users/MarkBind/received_events","type":"Organization","site_admin":false},"repo":{"id":79786692,"node_id":"MDEwOlJlcG9zaXRvcnk3OTc4NjY5Mg==","name":"vue-strap","full_name":"MarkBind/vue-strap","owner":{"login":"MarkBind","id":25006893,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDA2ODkz","avatar_url":"https://avatars1.githubusercontent.com/u/25006893?v=4","gravatar_id":"","url":"https://api.github.com/users/MarkBind","html_url":"https://github.com/MarkBind","followers_url":"https://api.github.com/users/MarkBind/followers","following_url":"https://api.github.com/users/MarkBind/following{/other_user}","gists_url":"https://api.github.com/users/MarkBind/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkBind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkBind/subscriptions","organizations_url":"https://api.github.com/users/MarkBind/orgs","repos_url":"https://api.github.com/users/MarkBind/repos","events_url":"https://api.github.com/users/MarkBind/events{/privacy}","received_events_url":"https://api.github.com/users/MarkBind/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MarkBind/vue-strap","description":"Bootstrap components built with Vue.js","fork":true,"url":"https://api.github.com/repos/MarkBind/vue-strap","forks_url":"https://api.github.com/repos/MarkBind/vue-strap/forks","keys_url":"https://api.github.com/repos/MarkBind/vue-strap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarkBind/vue-strap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarkBind/vue-strap/teams","hooks_url":"https://api.github.com/repos/MarkBind/vue-strap/hooks","issue_events_url":"https://api.github.com/repos/MarkBind/vue-strap/issues/events{/number}","events_url":"https://api.github.com/repos/MarkBind/vue-strap/events","assignees_url":"https://api.github.com/repos/MarkBind/vue-strap/assignees{/user}","branches_url":"https://api.github.com/repos/MarkBind/vue-strap/branches{/branch}","tags_url":"https://api.github.com/repos/MarkBind/vue-strap/tags","blobs_url":"https://api.github.com/repos/MarkBind/vue-strap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarkBind/vue-strap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarkBind/vue-strap/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarkBind/vue-strap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarkBind/vue-strap/statuses/{sha}","languages_url":"https://api.github.com/repos/MarkBind/vue-strap/languages","stargazers_url":"https://api.github.com/repos/MarkBind/vue-strap/stargazers","contributors_url":"https://api.github.com/repos/MarkBind/vue-strap/contributors","subscribers_url":"https://api.github.com/repos/MarkBind/vue-strap/subscribers","subscription_url":"https://api.github.com/repos/MarkBind/vue-strap/subscription","commits_url":"https://api.github.com/repos/MarkBind/vue-strap/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarkBind/vue-strap/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarkBind/vue-strap/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarkBind/vue-strap/issues/comments{/number}","contents_url":"https://api.github.com/repos/MarkBind/vue-strap/contents/{+path}","compare_url":"https://api.github.com/repos/MarkBind/vue-strap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarkBind/vue-strap/merges","archive_url":"https://api.github.com/repos/MarkBind/vue-strap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarkBind/vue-strap/downloads","issues_url":"https://api.github.com/repos/MarkBind/vue-strap/issues{/number}","pulls_url":"https://api.github.com/repos/MarkBind/vue-strap/pulls{/number}","milestones_url":"https://api.github.com/repos/MarkBind/vue-strap/milestones{/number}","notifications_url":"https://api.github.com/repos/MarkBind/vue-strap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarkBind/vue-strap/labels{/name}","releases_url":"https://api.github.com/repos/MarkBind/vue-strap/releases{/id}","deployments_url":"https://api.github.com/repos/MarkBind/vue-strap/deployments","created_at":"2017-01-23T08:50:49Z","updated_at":"2018-06-04T05:52:46Z","pushed_at":"2018-06-06T05:21:42Z","git_url":"git://github.com/MarkBind/vue-strap.git","ssh_url":"git@github.com:MarkBind/vue-strap.git","clone_url":"https://github.com/MarkBind/vue-strap.git","svn_url":"https://github.com/MarkBind/vue-strap","homepage":"http://MarkBind.github.io/vue-strap/","size":28370,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":10,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32"},"html":{"href":"https://github.com/MarkBind/vue-strap/pull/32"},"issue":{"href":"https://api.github.com/repos/MarkBind/vue-strap/issues/32"},"comments":{"href":"https://api.github.com/repos/MarkBind/vue-strap/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/MarkBind/vue-strap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MarkBind/vue-strap/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/MarkBind/vue-strap/statuses/141442abd7d7c29de8c15e6187277f98619c01ac"}},"author_association":"NONE"}}
{"actor":{"display_login":"yamgent"}}