{"action":"created","comment":{"url":"https://api.github.com/repos/domenic/ecmarkdown/pulls/comments/35830521","id":35830521,"diff_hunk":"@@ -41,33 +41,56 @@ instead of\n \n ## Syntax\n \n-_NOTE: this section is a bit in flux after recent changes. Please use the latest released-to-npm release for a stable syntax; we promise we will nail everything down before doing another release._\n-\n ### Top-Level Constructs\n+The following is a partial EBNF for the top-level constructs in Ecmarkdown.\n+\n+```\n+Document = Paragraph , [ { \"\\n\\n\" , Paragraph  } ] ;\n \n-An Ecmarkdown **document**, processed using the `ecmarkdown.document(string)` export, is composed of multiple pararaphs.\n+Paragraph = OrderedList | UnorderedList | NonList ;\n \n-A **paragraph** can be either a list or non-list paragraph.\n+OrderedList = OrderedListItem , [ { \"\\n\" , OrderedListItem | UnorderedListItem } ] ;\n \n-A **list** is composed of one or more **list items**, which are segments. Non-list paragraphs are also segments.\n+UnorderedList = UnorderedListItem , [ { \"\\n\" , OrderedListItem | UnorderedListItem } ] ;\n \n-A **segment** is a list of non-formatting characters (i.e., literal text) and formatting characters.\n+OrderedListItem = { white space } , { digit } , \".\" , space , Fragment ;\n \n-An Ecmarkdown **fragment**, processed using the `ecmarkdown.fragment(string)` export, is a segment that is assumed to contain no HTML. Thus, you can pass in `` \"`2 < 3`\" `` as a fragment, and you'll get back as the output HTML `\"<code>2 &lt; 3</code>\"`.\n+UnorderedListItem = { white space } , \"*\" , space , Fragment ;\n \n-Ecmarkdown also allows HTML comments anywhere that does not otherwise disturb the parsing. They are included in the resulting output, in the equivalent location.\n+NonList = Fragment ;\n+\n+Fragment = { StarFormat | UnderscoreFormat | TildeFormat\n+         | TickFormat | PipeFormat | Text } ;\n+         // could consider renaming to output element\n+\n+StarFormat = \"*\" , Text , \"*\" ;\n+// With some complex restrictions on surrounding context to match gmd semantics\n+\n+// and etc. for each fragment type except TickFragment which has no context\n+// restrictions per gmd semantics and UnderscoreFormat which doesn't allow whitespace\n+// or format characters inside of it.\n+```\n+\n+The key takeaways from this grammar are the following:\n+\n+* Paragraphs are separated by two line breaks\n+* Paragraphs can either be lists or non-lists.\n+* Lists can be ordered or unordered. List items must be preceded by a line break. You can have a ordered list as a sublist in an unordered list and vice versa.\n+* List items and non-list paragraphs are Fragments. Fragments are a series of one or more formats or plain text.\n+\n+Ecmarkdown also allows HTML tags and comments anywhere that does not otherwise disturb the parsing. They are included in the resulting output, in the equivalent location.\n \n ### Lists\n \n-Lists are written as a series of lines, each starting with a number, e.g. `1.`. The first list item's number determines the starting number in the output (via `<ol start=\"x\">`); subsequent list items' numbers are ignored.\n+Lists are written as a series of lines, each starting with either a number, e.g. `1.`, or a star, e.g. `*`. The first list item's number determines the starting number in the output (via `<ol start=\"x\">`); subsequent list items' numbers are ignored.","path":"README.md","position":73,"original_position":72,"commit_id":"dcd9e525e3cc5ee37d234d3b1383a1827dc6234a","original_commit_id":"64559e14816fff5086119bab3cdfa89409efde91","user":{"login":"jmdyck","id":4344001,"avatar_url":"https://avatars.githubusercontent.com/u/4344001?v=3","gravatar_id":"","url":"https://api.github.com/users/jmdyck","html_url":"https://github.com/jmdyck","followers_url":"https://api.github.com/users/jmdyck/followers","following_url":"https://api.github.com/users/jmdyck/following{/other_user}","gists_url":"https://api.github.com/users/jmdyck/gists{/gist_id}","starred_url":"https://api.github.com/users/jmdyck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmdyck/subscriptions","organizations_url":"https://api.github.com/users/jmdyck/orgs","repos_url":"https://api.github.com/users/jmdyck/repos","events_url":"https://api.github.com/users/jmdyck/events{/privacy}","received_events_url":"https://api.github.com/users/jmdyck/received_events","type":"User","site_admin":false},"body":"If (as indicated in issue #28) `Text` can contain linebreaks (as long as it isn't two adjacent ones), then the grammar would allow the following as an `OrderedList`:\r\n\r\n    1. This is the first item,\r\n       which I've split into two lines.\r\n    2. This is the second item,\r\n       which is\r\n       three lines long.\r\n\r\nHowever, that conflicts with the statement here that each line of a list starts with either a number or a star.\r\n\r\nMaybe instead, each list is a series of *items*, each starting with etc.","created_at":"2015-07-30T01:18:32Z","updated_at":"2015-07-30T01:18:32Z","html_url":"https://github.com/domenic/ecmarkdown/pull/33#discussion_r35830521","pull_request_url":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/domenic/ecmarkdown/pulls/comments/35830521"},"html":{"href":"https://github.com/domenic/ecmarkdown/pull/33#discussion_r35830521"},"pull_request":{"href":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33","id":41179804,"html_url":"https://github.com/domenic/ecmarkdown/pull/33","diff_url":"https://github.com/domenic/ecmarkdown/pull/33.diff","patch_url":"https://github.com/domenic/ecmarkdown/pull/33.patch","issue_url":"https://api.github.com/repos/domenic/ecmarkdown/issues/33","number":33,"state":"closed","locked":false,"title":"Readme updates","user":{"login":"bterlson","id":11236,"avatar_url":"https://avatars.githubusercontent.com/u/11236?v=3","gravatar_id":"","url":"https://api.github.com/users/bterlson","html_url":"https://github.com/bterlson","followers_url":"https://api.github.com/users/bterlson/followers","following_url":"https://api.github.com/users/bterlson/following{/other_user}","gists_url":"https://api.github.com/users/bterlson/gists{/gist_id}","starred_url":"https://api.github.com/users/bterlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bterlson/subscriptions","organizations_url":"https://api.github.com/users/bterlson/orgs","repos_url":"https://api.github.com/users/bterlson/repos","events_url":"https://api.github.com/users/bterlson/events{/privacy}","received_events_url":"https://api.github.com/users/bterlson/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-29T22:28:30Z","updated_at":"2015-07-30T01:18:32Z","closed_at":"2015-07-29T23:42:12Z","merged_at":null,"merge_commit_sha":"acefff862a18f19e23093d76ce65349a4776070c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33/commits","review_comments_url":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33/comments","review_comment_url":"https://api.github.com/repos/domenic/ecmarkdown/pulls/comments{/number}","comments_url":"https://api.github.com/repos/domenic/ecmarkdown/issues/33/comments","statuses_url":"https://api.github.com/repos/domenic/ecmarkdown/statuses/dcd9e525e3cc5ee37d234d3b1383a1827dc6234a","head":{"label":"bterlson:readme-updates","ref":"readme-updates","sha":"dcd9e525e3cc5ee37d234d3b1383a1827dc6234a","user":{"login":"bterlson","id":11236,"avatar_url":"https://avatars.githubusercontent.com/u/11236?v=3","gravatar_id":"","url":"https://api.github.com/users/bterlson","html_url":"https://github.com/bterlson","followers_url":"https://api.github.com/users/bterlson/followers","following_url":"https://api.github.com/users/bterlson/following{/other_user}","gists_url":"https://api.github.com/users/bterlson/gists{/gist_id}","starred_url":"https://api.github.com/users/bterlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bterlson/subscriptions","organizations_url":"https://api.github.com/users/bterlson/orgs","repos_url":"https://api.github.com/users/bterlson/repos","events_url":"https://api.github.com/users/bterlson/events{/privacy}","received_events_url":"https://api.github.com/users/bterlson/received_events","type":"User","site_admin":false},"repo":{"id":34885774,"name":"ecmarkdown","full_name":"bterlson/ecmarkdown","owner":{"login":"bterlson","id":11236,"avatar_url":"https://avatars.githubusercontent.com/u/11236?v=3","gravatar_id":"","url":"https://api.github.com/users/bterlson","html_url":"https://github.com/bterlson","followers_url":"https://api.github.com/users/bterlson/followers","following_url":"https://api.github.com/users/bterlson/following{/other_user}","gists_url":"https://api.github.com/users/bterlson/gists{/gist_id}","starred_url":"https://api.github.com/users/bterlson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bterlson/subscriptions","organizations_url":"https://api.github.com/users/bterlson/orgs","repos_url":"https://api.github.com/users/bterlson/repos","events_url":"https://api.github.com/users/bterlson/events{/privacy}","received_events_url":"https://api.github.com/users/bterlson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bterlson/ecmarkdown","description":"A shorthand language for writing ECMAScript-style algorithms, inspired by Markdown","fork":true,"url":"https://api.github.com/repos/bterlson/ecmarkdown","forks_url":"https://api.github.com/repos/bterlson/ecmarkdown/forks","keys_url":"https://api.github.com/repos/bterlson/ecmarkdown/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bterlson/ecmarkdown/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bterlson/ecmarkdown/teams","hooks_url":"https://api.github.com/repos/bterlson/ecmarkdown/hooks","issue_events_url":"https://api.github.com/repos/bterlson/ecmarkdown/issues/events{/number}","events_url":"https://api.github.com/repos/bterlson/ecmarkdown/events","assignees_url":"https://api.github.com/repos/bterlson/ecmarkdown/assignees{/user}","branches_url":"https://api.github.com/repos/bterlson/ecmarkdown/branches{/branch}","tags_url":"https://api.github.com/repos/bterlson/ecmarkdown/tags","blobs_url":"https://api.github.com/repos/bterlson/ecmarkdown/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bterlson/ecmarkdown/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bterlson/ecmarkdown/git/refs{/sha}","trees_url":"https://api.github.com/repos/bterlson/ecmarkdown/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bterlson/ecmarkdown/statuses/{sha}","languages_url":"https://api.github.com/repos/bterlson/ecmarkdown/languages","stargazers_url":"https://api.github.com/repos/bterlson/ecmarkdown/stargazers","contributors_url":"https://api.github.com/repos/bterlson/ecmarkdown/contributors","subscribers_url":"https://api.github.com/repos/bterlson/ecmarkdown/subscribers","subscription_url":"https://api.github.com/repos/bterlson/ecmarkdown/subscription","commits_url":"https://api.github.com/repos/bterlson/ecmarkdown/commits{/sha}","git_commits_url":"https://api.github.com/repos/bterlson/ecmarkdown/git/commits{/sha}","comments_url":"https://api.github.com/repos/bterlson/ecmarkdown/comments{/number}","issue_comment_url":"https://api.github.com/repos/bterlson/ecmarkdown/issues/comments{/number}","contents_url":"https://api.github.com/repos/bterlson/ecmarkdown/contents/{+path}","compare_url":"https://api.github.com/repos/bterlson/ecmarkdown/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bterlson/ecmarkdown/merges","archive_url":"https://api.github.com/repos/bterlson/ecmarkdown/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bterlson/ecmarkdown/downloads","issues_url":"https://api.github.com/repos/bterlson/ecmarkdown/issues{/number}","pulls_url":"https://api.github.com/repos/bterlson/ecmarkdown/pulls{/number}","milestones_url":"https://api.github.com/repos/bterlson/ecmarkdown/milestones{/number}","notifications_url":"https://api.github.com/repos/bterlson/ecmarkdown/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bterlson/ecmarkdown/labels{/name}","releases_url":"https://api.github.com/repos/bterlson/ecmarkdown/releases{/id}","created_at":"2015-05-01T01:57:08Z","updated_at":"2015-05-01T01:57:30Z","pushed_at":"2015-07-29T23:31:58Z","git_url":"git://github.com/bterlson/ecmarkdown.git","ssh_url":"git@github.com:bterlson/ecmarkdown.git","clone_url":"https://github.com/bterlson/ecmarkdown.git","svn_url":"https://github.com/bterlson/ecmarkdown","homepage":null,"size":231,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"domenic:master","ref":"master","sha":"9977c14a1f028e7cf6f90cfcf210774c7dfa5a30","user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"repo":{"id":23796186,"name":"ecmarkdown","full_name":"domenic/ecmarkdown","owner":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/domenic/ecmarkdown","description":"A shorthand language for writing ECMAScript-style algorithms, inspired by Markdown","fork":false,"url":"https://api.github.com/repos/domenic/ecmarkdown","forks_url":"https://api.github.com/repos/domenic/ecmarkdown/forks","keys_url":"https://api.github.com/repos/domenic/ecmarkdown/keys{/key_id}","collaborators_url":"https://api.github.com/repos/domenic/ecmarkdown/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/domenic/ecmarkdown/teams","hooks_url":"https://api.github.com/repos/domenic/ecmarkdown/hooks","issue_events_url":"https://api.github.com/repos/domenic/ecmarkdown/issues/events{/number}","events_url":"https://api.github.com/repos/domenic/ecmarkdown/events","assignees_url":"https://api.github.com/repos/domenic/ecmarkdown/assignees{/user}","branches_url":"https://api.github.com/repos/domenic/ecmarkdown/branches{/branch}","tags_url":"https://api.github.com/repos/domenic/ecmarkdown/tags","blobs_url":"https://api.github.com/repos/domenic/ecmarkdown/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/domenic/ecmarkdown/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/domenic/ecmarkdown/git/refs{/sha}","trees_url":"https://api.github.com/repos/domenic/ecmarkdown/git/trees{/sha}","statuses_url":"https://api.github.com/repos/domenic/ecmarkdown/statuses/{sha}","languages_url":"https://api.github.com/repos/domenic/ecmarkdown/languages","stargazers_url":"https://api.github.com/repos/domenic/ecmarkdown/stargazers","contributors_url":"https://api.github.com/repos/domenic/ecmarkdown/contributors","subscribers_url":"https://api.github.com/repos/domenic/ecmarkdown/subscribers","subscription_url":"https://api.github.com/repos/domenic/ecmarkdown/subscription","commits_url":"https://api.github.com/repos/domenic/ecmarkdown/commits{/sha}","git_commits_url":"https://api.github.com/repos/domenic/ecmarkdown/git/commits{/sha}","comments_url":"https://api.github.com/repos/domenic/ecmarkdown/comments{/number}","issue_comment_url":"https://api.github.com/repos/domenic/ecmarkdown/issues/comments{/number}","contents_url":"https://api.github.com/repos/domenic/ecmarkdown/contents/{+path}","compare_url":"https://api.github.com/repos/domenic/ecmarkdown/compare/{base}...{head}","merges_url":"https://api.github.com/repos/domenic/ecmarkdown/merges","archive_url":"https://api.github.com/repos/domenic/ecmarkdown/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/domenic/ecmarkdown/downloads","issues_url":"https://api.github.com/repos/domenic/ecmarkdown/issues{/number}","pulls_url":"https://api.github.com/repos/domenic/ecmarkdown/pulls{/number}","milestones_url":"https://api.github.com/repos/domenic/ecmarkdown/milestones{/number}","notifications_url":"https://api.github.com/repos/domenic/ecmarkdown/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/domenic/ecmarkdown/labels{/name}","releases_url":"https://api.github.com/repos/domenic/ecmarkdown/releases{/id}","created_at":"2014-09-08T15:24:19Z","updated_at":"2015-07-24T20:18:31Z","pushed_at":"2015-07-29T23:44:40Z","git_url":"git://github.com/domenic/ecmarkdown.git","ssh_url":"git@github.com:domenic/ecmarkdown.git","clone_url":"https://github.com/domenic/ecmarkdown.git","svn_url":"https://github.com/domenic/ecmarkdown","homepage":null,"size":458,"stargazers_count":19,"watchers_count":19,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33"},"html":{"href":"https://github.com/domenic/ecmarkdown/pull/33"},"issue":{"href":"https://api.github.com/repos/domenic/ecmarkdown/issues/33"},"comments":{"href":"https://api.github.com/repos/domenic/ecmarkdown/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/domenic/ecmarkdown/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/domenic/ecmarkdown/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/domenic/ecmarkdown/statuses/dcd9e525e3cc5ee37d234d3b1383a1827dc6234a"}}}}