diff options
| -rw-r--r-- | def.peg | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -8,15 +8,23 @@ Markdown <- MetaBlock* Block* # Block elements -Block <- Header / List / LinkDefinition / Paragraph +Block <- Header + / List + / LinkDefinition + / Paragraph Header <- '#'+ SPACE* !NEWLINE Words? SPACE* NEWLINE List <- ([-*]+ / [[:digit:]]+ [).]) (_ (List / Words))? NEWLINE LinkDefinition <- LinkLabel ':' _? Uri (_ LinkTitle)? NEWLINE Paragraph <- Words (HardBreak Words)* NEWLINE+ # Inline elements -Words <- StyledWords / LinkedWords / AnnotatedWords / PlainWords -StyledWords <- '*' Words '*' / '**' Words '**' / '_' Words '_' +Words <- StyledWords + / LinkedWords + / AnnotatedWords + / PlainWords +StyledWords <- '*' Words '*' + / '**' Words '**' + / '_' Words '_' LinkedWords <- '[' Words ']' '(' ((Uri _)? LinkTitle / Uri) ')' / '[' Words ']' LinkLabel / LinkLabel @@ -26,11 +34,15 @@ LinkTitle <- '"' _? !'"' _? PlainWords _? '"' / "'" _? !"'" PlainWords _? "'" / "(" _? ![()] PlainWords _? ")" PlainWords <- PRINTABLES (_ PRINTABLES)* -Uri <- '<' ![<>] PRINTABLES? '>' / ![<>] PRINTABLES +Uri <- '<' ![<>] PRINTABLES? '>' + / ![<>] PRINTABLES HardBreak <- SPACE SPACE+ NEWLINE -_ <- SPACE+ / SPACE? NEWLINE SPACE? SPACE? SPACE? +_ <- SPACE+ + / SPACE? NEWLINE SPACE? SPACE? SPACE? # Terminals PRINTABLES <- [[:graph:]]+ SPACE <- ' ' -NEWLINE <- '\r\n' / '\n' / '\r' +NEWLINE <- '\r\n' + / '\n' + / '\r' |
