{"action":"created","comment":{"url":"https://api.github.com/repos/deepflame/opensong.js/pulls/comments/52925231","id":52925231,"diff_hunk":"@@ -0,0 +1,131 @@\n+var opensong = opensong || {};\n+opensong.helper = opensong.helper || {};\n+\n+/*\n+\n+json = [\n+  {\n+    header: \"V\",\n+    lines: [\n+      {\n+        chords: [\"A\", \"C\"],\n+        lyrics: [\n+          [\"Yeah\", \"Yeah, God is great!\"]\n+        ]\n+      },\n+      {\n+        comments: \"This is a comment\"\n+      }\n+    ]\n+  }\n+]\n+\n+*/\n+opensong.helper.parseLyrics = function(lyrics) {\n+  lyrics = lyrics.replace(/\\r\\n?/g, '\\n');\n+  var lyricsLines = lyrics.split(\"\\n\");\n+\n+  var dataModel = [];\n+  var dataObject =\n+    {header: undefined,\n+    lines: []\n+    };\n+  dataModel.push(dataObject);\n+\n+  while (lyricsLines.length > 0) {\n+    var line = lyricsLines.shift();\n+\n+    if (!(typeof line !== \"undefined\" && line !== null)) { continue; }\n+\n+    switch (line[0]) {\n+      // header\n+      case \"[\":\n+        // add new object if current is \"used\"\n+        if (dataObject.lines.length > 0) {\n+          dataObject =\n+            {header: undefined,\n+            lines: []\n+            };\n+          dataModel.push(dataObject);\n+        }\n+\n+        var header = line.match(/\\[(.*)\\]/)[1];\n+        dataObject.header = header;\n+        break;\n+\n+      // chords (with lyrics)\n+      case \".\":\n+        var chordsLine = line.substr(1);\n+        var chordArr = [];\n+\n+        // split cords\n+        while (chordsLine.length > 0) {\n+          var m = /^(\\S*\\s*)(.*)/.exec(chordsLine);\n+          chordArr.push(m[1]);\n+          chordsLine = m[2];\n+        }\n+        // add an item if it is an empty line\n+        if (chordArr.length === 0) { chordArr.push(chordsLine); }\n+\n+        // clean Chord line from trailing white spaces\n+        var chordArrCleaned = [];\n+        chordArr.forEach(function(value) {\n+          m = /(\\S*\\s?)\\s*/.exec(value);\n+          return chordArrCleaned.push(m[1]);\n+        });\n+\n+        var textLine = \"\";\n+        var textLineArr = [];\n+        m = null;\n+\n+        // while we have lines that match a textLine create an html table row\n+        while ((textLine = lyricsLines.shift()) && (m = textLine.match(/^([ 1-9])(.*)/))) {","path":"src/opensong-parser.js","position":82,"original_position":82,"commit_id":"ff3b8ba3ac18b802a60154b0dcb4a095453ae202","original_commit_id":"ff3b8ba3ac18b802a60154b0dcb4a095453ae202","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long.<br>'m' used out of scope.","created_at":"2016-02-15T17:28:26Z","updated_at":"2016-02-15T17:28:26Z","html_url":"https://github.com/deepflame/opensong.js/pull/1#discussion_r52925231","pull_request_url":"https://api.github.com/repos/deepflame/opensong.js/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/deepflame/opensong.js/pulls/comments/52925231"},"html":{"href":"https://github.com/deepflame/opensong.js/pull/1#discussion_r52925231"},"pull_request":{"href":"https://api.github.com/repos/deepflame/opensong.js/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/deepflame/opensong.js/pulls/1","id":59277344,"html_url":"https://github.com/deepflame/opensong.js/pull/1","diff_url":"https://github.com/deepflame/opensong.js/pull/1.diff","patch_url":"https://github.com/deepflame/opensong.js/pull/1.patch","issue_url":"https://api.github.com/repos/deepflame/opensong.js/issues/1","number":1,"state":"open","locked":false,"title":"es6-rewrite","user":{"login":"deepflame","id":91208,"avatar_url":"https://avatars.githubusercontent.com/u/91208?v=3","gravatar_id":"","url":"https://api.github.com/users/deepflame","html_url":"https://github.com/deepflame","followers_url":"https://api.github.com/users/deepflame/followers","following_url":"https://api.github.com/users/deepflame/following{/other_user}","gists_url":"https://api.github.com/users/deepflame/gists{/gist_id}","starred_url":"https://api.github.com/users/deepflame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepflame/subscriptions","organizations_url":"https://api.github.com/users/deepflame/orgs","repos_url":"https://api.github.com/users/deepflame/repos","events_url":"https://api.github.com/users/deepflame/events{/privacy}","received_events_url":"https://api.github.com/users/deepflame/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-13T20:36:37Z","updated_at":"2016-02-15T17:28:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98d8e107a068a8a8a02fca1346d1823f4cfc9a93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/deepflame/opensong.js/pulls/1/commits","review_comments_url":"https://api.github.com/repos/deepflame/opensong.js/pulls/1/comments","review_comment_url":"https://api.github.com/repos/deepflame/opensong.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/deepflame/opensong.js/issues/1/comments","statuses_url":"https://api.github.com/repos/deepflame/opensong.js/statuses/ff3b8ba3ac18b802a60154b0dcb4a095453ae202","head":{"label":"deepflame:feature/es6-rewrite","ref":"feature/es6-rewrite","sha":"ff3b8ba3ac18b802a60154b0dcb4a095453ae202","user":{"login":"deepflame","id":91208,"avatar_url":"https://avatars.githubusercontent.com/u/91208?v=3","gravatar_id":"","url":"https://api.github.com/users/deepflame","html_url":"https://github.com/deepflame","followers_url":"https://api.github.com/users/deepflame/followers","following_url":"https://api.github.com/users/deepflame/following{/other_user}","gists_url":"https://api.github.com/users/deepflame/gists{/gist_id}","starred_url":"https://api.github.com/users/deepflame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepflame/subscriptions","organizations_url":"https://api.github.com/users/deepflame/orgs","repos_url":"https://api.github.com/users/deepflame/repos","events_url":"https://api.github.com/users/deepflame/events{/privacy}","received_events_url":"https://api.github.com/users/deepflame/received_events","type":"User","site_admin":false},"repo":{"id":3166881,"name":"opensong.js","full_name":"deepflame/opensong.js","owner":{"login":"deepflame","id":91208,"avatar_url":"https://avatars.githubusercontent.com/u/91208?v=3","gravatar_id":"","url":"https://api.github.com/users/deepflame","html_url":"https://github.com/deepflame","followers_url":"https://api.github.com/users/deepflame/followers","following_url":"https://api.github.com/users/deepflame/following{/other_user}","gists_url":"https://api.github.com/users/deepflame/gists{/gist_id}","starred_url":"https://api.github.com/users/deepflame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepflame/subscriptions","organizations_url":"https://api.github.com/users/deepflame/orgs","repos_url":"https://api.github.com/users/deepflame/repos","events_url":"https://api.github.com/users/deepflame/events{/privacy}","received_events_url":"https://api.github.com/users/deepflame/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deepflame/opensong.js","description":"Javascript/Coffeescript library to display OpenSong lyrics in a nice way","fork":false,"url":"https://api.github.com/repos/deepflame/opensong.js","forks_url":"https://api.github.com/repos/deepflame/opensong.js/forks","keys_url":"https://api.github.com/repos/deepflame/opensong.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deepflame/opensong.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deepflame/opensong.js/teams","hooks_url":"https://api.github.com/repos/deepflame/opensong.js/hooks","issue_events_url":"https://api.github.com/repos/deepflame/opensong.js/issues/events{/number}","events_url":"https://api.github.com/repos/deepflame/opensong.js/events","assignees_url":"https://api.github.com/repos/deepflame/opensong.js/assignees{/user}","branches_url":"https://api.github.com/repos/deepflame/opensong.js/branches{/branch}","tags_url":"https://api.github.com/repos/deepflame/opensong.js/tags","blobs_url":"https://api.github.com/repos/deepflame/opensong.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deepflame/opensong.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deepflame/opensong.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/deepflame/opensong.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deepflame/opensong.js/statuses/{sha}","languages_url":"https://api.github.com/repos/deepflame/opensong.js/languages","stargazers_url":"https://api.github.com/repos/deepflame/opensong.js/stargazers","contributors_url":"https://api.github.com/repos/deepflame/opensong.js/contributors","subscribers_url":"https://api.github.com/repos/deepflame/opensong.js/subscribers","subscription_url":"https://api.github.com/repos/deepflame/opensong.js/subscription","commits_url":"https://api.github.com/repos/deepflame/opensong.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/deepflame/opensong.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/deepflame/opensong.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/deepflame/opensong.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/deepflame/opensong.js/contents/{+path}","compare_url":"https://api.github.com/repos/deepflame/opensong.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deepflame/opensong.js/merges","archive_url":"https://api.github.com/repos/deepflame/opensong.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deepflame/opensong.js/downloads","issues_url":"https://api.github.com/repos/deepflame/opensong.js/issues{/number}","pulls_url":"https://api.github.com/repos/deepflame/opensong.js/pulls{/number}","milestones_url":"https://api.github.com/repos/deepflame/opensong.js/milestones{/number}","notifications_url":"https://api.github.com/repos/deepflame/opensong.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deepflame/opensong.js/labels{/name}","releases_url":"https://api.github.com/repos/deepflame/opensong.js/releases{/id}","deployments_url":"https://api.github.com/repos/deepflame/opensong.js/deployments","created_at":"2012-01-12T23:22:26Z","updated_at":"2015-12-31T18:08:58Z","pushed_at":"2016-02-15T17:27:44Z","git_url":"git://github.com/deepflame/opensong.js.git","ssh_url":"git@github.com:deepflame/opensong.js.git","clone_url":"https://github.com/deepflame/opensong.js.git","svn_url":"https://github.com/deepflame/opensong.js","homepage":"deepflame.github.io/opensong.js","size":419,"stargazers_count":6,"watchers_count":6,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":6,"default_branch":"master"}},"base":{"label":"deepflame:master","ref":"master","sha":"3f63d1ce3e39869bf16ceede8bfb103be41ad9ef","user":{"login":"deepflame","id":91208,"avatar_url":"https://avatars.githubusercontent.com/u/91208?v=3","gravatar_id":"","url":"https://api.github.com/users/deepflame","html_url":"https://github.com/deepflame","followers_url":"https://api.github.com/users/deepflame/followers","following_url":"https://api.github.com/users/deepflame/following{/other_user}","gists_url":"https://api.github.com/users/deepflame/gists{/gist_id}","starred_url":"https://api.github.com/users/deepflame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepflame/subscriptions","organizations_url":"https://api.github.com/users/deepflame/orgs","repos_url":"https://api.github.com/users/deepflame/repos","events_url":"https://api.github.com/users/deepflame/events{/privacy}","received_events_url":"https://api.github.com/users/deepflame/received_events","type":"User","site_admin":false},"repo":{"id":3166881,"name":"opensong.js","full_name":"deepflame/opensong.js","owner":{"login":"deepflame","id":91208,"avatar_url":"https://avatars.githubusercontent.com/u/91208?v=3","gravatar_id":"","url":"https://api.github.com/users/deepflame","html_url":"https://github.com/deepflame","followers_url":"https://api.github.com/users/deepflame/followers","following_url":"https://api.github.com/users/deepflame/following{/other_user}","gists_url":"https://api.github.com/users/deepflame/gists{/gist_id}","starred_url":"https://api.github.com/users/deepflame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepflame/subscriptions","organizations_url":"https://api.github.com/users/deepflame/orgs","repos_url":"https://api.github.com/users/deepflame/repos","events_url":"https://api.github.com/users/deepflame/events{/privacy}","received_events_url":"https://api.github.com/users/deepflame/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deepflame/opensong.js","description":"Javascript/Coffeescript library to display OpenSong lyrics in a nice way","fork":false,"url":"https://api.github.com/repos/deepflame/opensong.js","forks_url":"https://api.github.com/repos/deepflame/opensong.js/forks","keys_url":"https://api.github.com/repos/deepflame/opensong.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deepflame/opensong.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deepflame/opensong.js/teams","hooks_url":"https://api.github.com/repos/deepflame/opensong.js/hooks","issue_events_url":"https://api.github.com/repos/deepflame/opensong.js/issues/events{/number}","events_url":"https://api.github.com/repos/deepflame/opensong.js/events","assignees_url":"https://api.github.com/repos/deepflame/opensong.js/assignees{/user}","branches_url":"https://api.github.com/repos/deepflame/opensong.js/branches{/branch}","tags_url":"https://api.github.com/repos/deepflame/opensong.js/tags","blobs_url":"https://api.github.com/repos/deepflame/opensong.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deepflame/opensong.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deepflame/opensong.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/deepflame/opensong.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deepflame/opensong.js/statuses/{sha}","languages_url":"https://api.github.com/repos/deepflame/opensong.js/languages","stargazers_url":"https://api.github.com/repos/deepflame/opensong.js/stargazers","contributors_url":"https://api.github.com/repos/deepflame/opensong.js/contributors","subscribers_url":"https://api.github.com/repos/deepflame/opensong.js/subscribers","subscription_url":"https://api.github.com/repos/deepflame/opensong.js/subscription","commits_url":"https://api.github.com/repos/deepflame/opensong.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/deepflame/opensong.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/deepflame/opensong.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/deepflame/opensong.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/deepflame/opensong.js/contents/{+path}","compare_url":"https://api.github.com/repos/deepflame/opensong.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deepflame/opensong.js/merges","archive_url":"https://api.github.com/repos/deepflame/opensong.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deepflame/opensong.js/downloads","issues_url":"https://api.github.com/repos/deepflame/opensong.js/issues{/number}","pulls_url":"https://api.github.com/repos/deepflame/opensong.js/pulls{/number}","milestones_url":"https://api.github.com/repos/deepflame/opensong.js/milestones{/number}","notifications_url":"https://api.github.com/repos/deepflame/opensong.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deepflame/opensong.js/labels{/name}","releases_url":"https://api.github.com/repos/deepflame/opensong.js/releases{/id}","deployments_url":"https://api.github.com/repos/deepflame/opensong.js/deployments","created_at":"2012-01-12T23:22:26Z","updated_at":"2015-12-31T18:08:58Z","pushed_at":"2016-02-15T17:27:44Z","git_url":"git://github.com/deepflame/opensong.js.git","ssh_url":"git@github.com:deepflame/opensong.js.git","clone_url":"https://github.com/deepflame/opensong.js.git","svn_url":"https://github.com/deepflame/opensong.js","homepage":"deepflame.github.io/opensong.js","size":419,"stargazers_count":6,"watchers_count":6,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/deepflame/opensong.js/pulls/1"},"html":{"href":"https://github.com/deepflame/opensong.js/pull/1"},"issue":{"href":"https://api.github.com/repos/deepflame/opensong.js/issues/1"},"comments":{"href":"https://api.github.com/repos/deepflame/opensong.js/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/deepflame/opensong.js/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/deepflame/opensong.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/deepflame/opensong.js/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/deepflame/opensong.js/statuses/ff3b8ba3ac18b802a60154b0dcb4a095453ae202"}}}}