{"action":"created","comment":{"url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/comments/91910292","pull_request_review_id":12418022,"id":91910292,"diff_hunk":"@@ -0,0 +1,42 @@\n+﻿using System;\n+using System.Linq;\n+\n+namespace Markdown\n+{\n+    public class OrderedListParser : Parser\n+    {\n+        public OrderedListParser(bool markdownAllowed) : base(markdownAllowed)\n+        {\n+        }\n+\n+        public override Line ParseLine(string text)\n+        {\n+            if (!IsListValue(text))\n+                return null;\n+            var parseResult = GetListValue(text);\n+            return new Line(parseResult, LineType.OrderedListLine, \"<ol>\", \"</ol>\");\n+        }\n+\n+        private static string GetListValue(string text)\n+        {\n+            var currentIndex = text.IndexOf(\".\", StringComparison.Ordinal);\n+            currentIndex++;\n+            while (text[currentIndex] == ' ')\n+                currentIndex++;\n+            return $\"<li>{text.Substring(currentIndex)}</li>\";\n+        }\n+\n+        private static bool IsListValue(string text)\n+        {\n+            var periodIndex = text.IndexOf(\".\", StringComparison.Ordinal);\n+            if (periodIndex == -1)\n+                return false;\n+            var partBeforeDot = text.Substring(0, periodIndex);\n+            if (partBeforeDot == \"\")\n+                return false;\n+            var partBeforeDotIsNumber = partBeforeDot.All(char.IsDigit);\n+            var periodBeforeSpaces = periodIndex < text.Length - 1 && text[periodIndex + 1] == ' ';","path":"Markdown/OrderedListParser.cs","position":41,"original_position":38,"commit_id":"8a4e318c153848b60c6eeb68e3db32764a2dfb45","original_commit_id":"7e236a52937e50aea585e46d2bccb4d15dbab205","user":{"login":"kipwoker","id":1760443,"avatar_url":"https://avatars.githubusercontent.com/u/1760443?v=3","gravatar_id":"","url":"https://api.github.com/users/kipwoker","html_url":"https://github.com/kipwoker","followers_url":"https://api.github.com/users/kipwoker/followers","following_url":"https://api.github.com/users/kipwoker/following{/other_user}","gists_url":"https://api.github.com/users/kipwoker/gists{/gist_id}","starred_url":"https://api.github.com/users/kipwoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kipwoker/subscriptions","organizations_url":"https://api.github.com/users/kipwoker/orgs","repos_url":"https://api.github.com/users/kipwoker/repos","events_url":"https://api.github.com/users/kipwoker/events{/privacy}","received_events_url":"https://api.github.com/users/kipwoker/received_events","type":"User","site_admin":false},"body":"Да, не. Всё проще. :)\r\nЭти проверки делаются достаточно часто для одного документа. Если предположить, что документ содержит кучу списков.\r\nМожно не делать проверку на 38 строке, если partBeforeDotIsNumber == false.","created_at":"2016-12-12T09:30:52Z","updated_at":"2016-12-12T09:30:53Z","html_url":"https://github.com/BurningMarshmallow/clean-code/pull/1#discussion_r91910292","pull_request_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/comments/91910292"},"html":{"href":"https://github.com/BurningMarshmallow/clean-code/pull/1#discussion_r91910292"},"pull_request":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1","id":93324712,"html_url":"https://github.com/BurningMarshmallow/clean-code/pull/1","diff_url":"https://github.com/BurningMarshmallow/clean-code/pull/1.diff","patch_url":"https://github.com/BurningMarshmallow/clean-code/pull/1.patch","issue_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/1","number":1,"state":"open","locked":false,"title":"Review","user":{"login":"mironov-alexey","id":6783167,"avatar_url":"https://avatars.githubusercontent.com/u/6783167?v=3","gravatar_id":"","url":"https://api.github.com/users/mironov-alexey","html_url":"https://github.com/mironov-alexey","followers_url":"https://api.github.com/users/mironov-alexey/followers","following_url":"https://api.github.com/users/mironov-alexey/following{/other_user}","gists_url":"https://api.github.com/users/mironov-alexey/gists{/gist_id}","starred_url":"https://api.github.com/users/mironov-alexey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mironov-alexey/subscriptions","organizations_url":"https://api.github.com/users/mironov-alexey/orgs","repos_url":"https://api.github.com/users/mironov-alexey/repos","events_url":"https://api.github.com/users/mironov-alexey/events{/privacy}","received_events_url":"https://api.github.com/users/mironov-alexey/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-11T12:28:14Z","updated_at":"2016-12-12T09:30:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b79fb64f9ea8c2659ce3186e692f051d0b79a91","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1/commits","review_comments_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1/comments","review_comment_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/1/comments","statuses_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/statuses/8a4e318c153848b60c6eeb68e3db32764a2dfb45","head":{"label":"BurningMarshmallow:master","ref":"master","sha":"8a4e318c153848b60c6eeb68e3db32764a2dfb45","user":{"login":"BurningMarshmallow","id":7406996,"avatar_url":"https://avatars.githubusercontent.com/u/7406996?v=3","gravatar_id":"","url":"https://api.github.com/users/BurningMarshmallow","html_url":"https://github.com/BurningMarshmallow","followers_url":"https://api.github.com/users/BurningMarshmallow/followers","following_url":"https://api.github.com/users/BurningMarshmallow/following{/other_user}","gists_url":"https://api.github.com/users/BurningMarshmallow/gists{/gist_id}","starred_url":"https://api.github.com/users/BurningMarshmallow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurningMarshmallow/subscriptions","organizations_url":"https://api.github.com/users/BurningMarshmallow/orgs","repos_url":"https://api.github.com/users/BurningMarshmallow/repos","events_url":"https://api.github.com/users/BurningMarshmallow/events{/privacy}","received_events_url":"https://api.github.com/users/BurningMarshmallow/received_events","type":"User","site_admin":false},"repo":{"id":72939978,"name":"clean-code","full_name":"BurningMarshmallow/clean-code","owner":{"login":"BurningMarshmallow","id":7406996,"avatar_url":"https://avatars.githubusercontent.com/u/7406996?v=3","gravatar_id":"","url":"https://api.github.com/users/BurningMarshmallow","html_url":"https://github.com/BurningMarshmallow","followers_url":"https://api.github.com/users/BurningMarshmallow/followers","following_url":"https://api.github.com/users/BurningMarshmallow/following{/other_user}","gists_url":"https://api.github.com/users/BurningMarshmallow/gists{/gist_id}","starred_url":"https://api.github.com/users/BurningMarshmallow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurningMarshmallow/subscriptions","organizations_url":"https://api.github.com/users/BurningMarshmallow/orgs","repos_url":"https://api.github.com/users/BurningMarshmallow/repos","events_url":"https://api.github.com/users/BurningMarshmallow/events{/privacy}","received_events_url":"https://api.github.com/users/BurningMarshmallow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BurningMarshmallow/clean-code","description":"Clean code","fork":true,"url":"https://api.github.com/repos/BurningMarshmallow/clean-code","forks_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/forks","keys_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/teams","hooks_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/hooks","issue_events_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/events{/number}","events_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/events","assignees_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/assignees{/user}","branches_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/branches{/branch}","tags_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/tags","blobs_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/statuses/{sha}","languages_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/languages","stargazers_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/stargazers","contributors_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/contributors","subscribers_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/subscribers","subscription_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/subscription","commits_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/contents/{+path}","compare_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/merges","archive_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/downloads","issues_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues{/number}","pulls_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls{/number}","milestones_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/milestones{/number}","notifications_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/labels{/name}","releases_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/releases{/id}","deployments_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/deployments","created_at":"2016-11-05T16:50:53Z","updated_at":"2016-11-05T16:50:55Z","pushed_at":"2016-12-09T19:00:08Z","git_url":"git://github.com/BurningMarshmallow/clean-code.git","ssh_url":"git@github.com:BurningMarshmallow/clean-code.git","clone_url":"https://github.com/BurningMarshmallow/clean-code.git","svn_url":"https://github.com/BurningMarshmallow/clean-code","homepage":null,"size":11823,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"BurningMarshmallow:BranchForPullRequest","ref":"BranchForPullRequest","sha":"389adf2d02ffe5de1df871163b76074e25230603","user":{"login":"BurningMarshmallow","id":7406996,"avatar_url":"https://avatars.githubusercontent.com/u/7406996?v=3","gravatar_id":"","url":"https://api.github.com/users/BurningMarshmallow","html_url":"https://github.com/BurningMarshmallow","followers_url":"https://api.github.com/users/BurningMarshmallow/followers","following_url":"https://api.github.com/users/BurningMarshmallow/following{/other_user}","gists_url":"https://api.github.com/users/BurningMarshmallow/gists{/gist_id}","starred_url":"https://api.github.com/users/BurningMarshmallow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurningMarshmallow/subscriptions","organizations_url":"https://api.github.com/users/BurningMarshmallow/orgs","repos_url":"https://api.github.com/users/BurningMarshmallow/repos","events_url":"https://api.github.com/users/BurningMarshmallow/events{/privacy}","received_events_url":"https://api.github.com/users/BurningMarshmallow/received_events","type":"User","site_admin":false},"repo":{"id":72939978,"name":"clean-code","full_name":"BurningMarshmallow/clean-code","owner":{"login":"BurningMarshmallow","id":7406996,"avatar_url":"https://avatars.githubusercontent.com/u/7406996?v=3","gravatar_id":"","url":"https://api.github.com/users/BurningMarshmallow","html_url":"https://github.com/BurningMarshmallow","followers_url":"https://api.github.com/users/BurningMarshmallow/followers","following_url":"https://api.github.com/users/BurningMarshmallow/following{/other_user}","gists_url":"https://api.github.com/users/BurningMarshmallow/gists{/gist_id}","starred_url":"https://api.github.com/users/BurningMarshmallow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurningMarshmallow/subscriptions","organizations_url":"https://api.github.com/users/BurningMarshmallow/orgs","repos_url":"https://api.github.com/users/BurningMarshmallow/repos","events_url":"https://api.github.com/users/BurningMarshmallow/events{/privacy}","received_events_url":"https://api.github.com/users/BurningMarshmallow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BurningMarshmallow/clean-code","description":"Clean code","fork":true,"url":"https://api.github.com/repos/BurningMarshmallow/clean-code","forks_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/forks","keys_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/teams","hooks_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/hooks","issue_events_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/events{/number}","events_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/events","assignees_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/assignees{/user}","branches_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/branches{/branch}","tags_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/tags","blobs_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/statuses/{sha}","languages_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/languages","stargazers_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/stargazers","contributors_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/contributors","subscribers_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/subscribers","subscription_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/subscription","commits_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/contents/{+path}","compare_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/merges","archive_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/downloads","issues_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues{/number}","pulls_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls{/number}","milestones_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/milestones{/number}","notifications_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/labels{/name}","releases_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/releases{/id}","deployments_url":"https://api.github.com/repos/BurningMarshmallow/clean-code/deployments","created_at":"2016-11-05T16:50:53Z","updated_at":"2016-11-05T16:50:55Z","pushed_at":"2016-12-09T19:00:08Z","git_url":"git://github.com/BurningMarshmallow/clean-code.git","ssh_url":"git@github.com:BurningMarshmallow/clean-code.git","clone_url":"https://github.com/BurningMarshmallow/clean-code.git","svn_url":"https://github.com/BurningMarshmallow/clean-code","homepage":null,"size":11823,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1"},"html":{"href":"https://github.com/BurningMarshmallow/clean-code/pull/1"},"issue":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/1"},"comments":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/BurningMarshmallow/clean-code/statuses/8a4e318c153848b60c6eeb68e3db32764a2dfb45"}}}}
{"actor":{"display_login":"kipwoker"}}