diff options
Diffstat (limited to 'def.peg')
| -rw-r--r-- | def.peg | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -9,13 +9,10 @@ Markdown <- MetaBlock* Block* # Block elements Block <- Header / List / LinkDefinition / Paragraph -Header <- '#'+ SPACE* Words? SPACE* NEWLINE -List <- ([-*]+ / [[:digit:]]+ [).]) (SPACE+ (List / Words))? - NEWLINE -LinkDefinition <- LinkLabel ':' SPACE Uri NEWLINE - SPACE SPACE '"' !'"' PlainWords '"' NEWLINE -Paragraph <- (Words (SPACE? NEWLINE / HardBreak))+ - NEWLINE+ +Header <- '#'+ SPACE* !NEWLINE Words? SPACE* NEWLINE +List <- ([-*]+ / [[:digit:]]+ [).]) (_ (List / Words))? NEWLINE +LinkDefinition <- LinkLabel ':' _? Uri (_ '"' !'"' PlainWords '"')? NEWLINE +Paragraph <- Words (HardBreak Words)* NEWLINE+ # Inline elements Words <- StyledWords / LinkedWords / AnnotatedWords / PlainWords @@ -24,10 +21,11 @@ LinkedWords <- '[' Words ']' '(' Uri ')' / '[' Words ']' LinkLabel / LinkLabel AnnotatedWords <- '[' Words ']' '{' ![{}] PlainWords '}' -LinkLabel <- '[' SPACE? ![\[\]] PlainWords SPACE? ']' -PlainWords <- PRINTABLES (SPACE PRINTABLES)* +LinkLabel <- '[' _? ![\[\]] PlainWords _? ']' +PlainWords <- PRINTABLES (_ PRINTABLES)* Uri <- '<' ![<>] PRINTABLES? '>' / ![<>] PRINTABLES HardBreak <- SPACE SPACE+ NEWLINE +_ <- SPACE+ / SPACE? NEWLINE SPACE? SPACE? SPACE? # Terminals PRINTABLES <- [[:graph:]]+ |
