Skip to content

Commit

Permalink
feat(frontend): add attributes grammar for paragraph
Browse files Browse the repository at this point in the history
Also fix attributes grammar for headings
  • Loading branch information
nfejzic committed Jan 13, 2022
1 parent f680542 commit c49d96f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/grammar/unimarkup.pest
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ atomic_block = { (!blank_line ~ ANY)+ }

// ****** HEADINGS ******
heading_start = @{ um_newline? ~ "#"{1,6} ~ um_nbsp }
heading_content = { ( !( um_newline ~ ( heading_start | attributes ) ) ~ ANY )+ }
heading = { heading_start ~ heading_content ~ um_nbsp* ~ ( um_newline ~ attributes )? }
heading_content = { ( !( um_newline ~ ( heading_start | ( um_nbsp* ~ attributes ) ) ) ~ ANY )+ }
heading = { heading_start ~ heading_content ~ um_nbsp* ~ ( um_newline ~ um_nbsp* ~ attributes )? }
headings = { heading+ }

// ****** PARAGRAPH ******
paragraph = { ANY+ }
par_attr = _{ um_newline ~ um_nbsp* ~ attributes }
par_content = { (!par_attr ~ ANY )+ }
paragraph = { par_content ~ par_attr? }

// ****** INLINE FORMATTING ******
escaped = { "\\" }
Expand Down

0 comments on commit c49d96f

Please sign in to comment.