From ba1aaf9246f7371bc4c4f8e6636baf44ddf28444 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 18 May 2025 11:08:01 +0200 Subject: define _ --- def.peg | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'def.peg') diff --git a/def.peg b/def.peg index 4e64c27..8bec09d 100644 --- a/def.peg +++ b/def.peg @@ -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:]]+ -- cgit v1.2.3