-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathletdown.ebnf
More file actions
45 lines (33 loc) · 871 Bytes
/
letdown.ebnf
File metadata and controls
45 lines (33 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(*
this grammar leaves out #tags and ;; comments ;; which are stripped out from
anywhere in the file, except within the bodies of code blocks and inline code.
*)
content = { block , "\n" } , EOF ;
block = heading
| list
| linkdef
| image
| quote
| hr
| code
| paragraph ;
heading = ( h1 | h2 | h3 ) , "\n" ;
h1 = "= " , TEXT ;
h2 = "== " , TEXT ;
h3 = "=== " , TEXT ;
hr = "---" , "\n";
linkdef = "[" , TEXT , "]: " , PATH , "\n"
image = "=> " , PATH , [ TEXT ] , "\n\n" ;
list = listitem , { listitem } ;
listitem = "- " , paragraph ;
quote = quoteline , { quoteline } ;
quoteline = "> " , paragraph ;
code = "```" , "\n" , TEXT , "\n" , "```\n\n" ;
paragraph = { span } , "\n" ;
span = link
| pre
| emphasis
| TEXT ;
link = "[" , TEXT , "]" ;
pre = "`" , TEXT , "`" ;
emphasis = "*" , TEXT , "*" ;