diff options
| author | Jonas Smedegaard <dr@jones.dk> | 2025-05-18 11:08:01 +0200 |
|---|---|---|
| committer | Jonas Smedegaard <dr@jones.dk> | 2025-05-18 14:04:21 +0200 |
| commit | ba1aaf9246f7371bc4c4f8e6636baf44ddf28444 (patch) | |
| tree | a8eb32ce0d7ad526e9fea948d5a71d345c6c7327 /def.peg | |
| parent | 72827171201ee9c022a6a8c30107e55a16c3826c (diff) | |
define _
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:]]+ |
