Skip to content

Commit

Permalink
Update grammar to match the peg-markdown (c30a78f)
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-rantakari authored and uranusjr committed Mar 9, 2016
1 parent abd381d commit eb41cf1
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions Dependency/peg-markdown-highlight/pmh_grammar.leg
Expand Up @@ -432,39 +432,37 @@ UlLine = "____" '_'* | Spacechar '_'+ &Spacechar

Emph = EmphStar | EmphUl

OneStarOpen = !StarLine < '*' > !Spacechar !Newline { $$ = elem(pmh_NO_TYPE); }
OneStarClose = !Spacechar !Newline Inline !StrongStar < '*' > { $$ = elem(pmh_NO_TYPE); }

EmphStar = s:OneStarOpen
( !OneStarClose Inline )*
OneStarClose
Whitespace = Spacechar | Newline

EmphStar = < s:LocMarker
'*' !Whitespace
( !'*' Inline
| StrongStar
)+
'*' >
{ ADD(elem_s(pmh_EMPH)); }

OneUlOpen = !UlLine < '_' > !Spacechar !Newline { $$ = elem(pmh_NO_TYPE); }
OneUlClose = !Spacechar !Newline Inline !StrongUl < '_' > !Alphanumeric { $$ = elem(pmh_NO_TYPE); }

EmphUl = s:OneUlOpen
( !OneUlClose Inline )*
OneUlClose
EmphUl = < s:LocMarker
'_' !Whitespace
( !'_' Inline
| StrongUl
)+
'_' >
{ ADD(elem_s(pmh_EMPH)); }

Strong = StrongStar | StrongUl

TwoStarOpen = !StarLine < "**" > !Spacechar !Newline { $$ = elem(pmh_NO_TYPE); }
TwoStarClose = !Spacechar !Newline Inline < "**" > { $$ = elem(pmh_NO_TYPE); }

StrongStar = s:TwoStarOpen
( !TwoStarClose Inline )*
TwoStarClose
StrongStar = < s:LocMarker
"**" !Whitespace
( !"**" Inline )+
"**" >
{ ADD(elem_s(pmh_STRONG)); }

TwoUlOpen = !UlLine < "__" > !Spacechar !Newline { $$ = elem(pmh_NO_TYPE); }
TwoUlClose = !Spacechar !Newline Inline < "__" > !Alphanumeric { $$ = elem(pmh_NO_TYPE); }

StrongUl = s:TwoUlOpen
( !TwoUlClose Inline )*
TwoUlClose
{ ADD(elem_s(pmh_STRONG)); }
StrongUl = < s:LocMarker
"__" !Whitespace
( !"__" Inline )+
"__" >
{ ADD(elem_s(pmh_STRONG)); }

Image = '!' ( ExplicitLink | ReferenceLink )
{
Expand Down

0 comments on commit eb41cf1

Please sign in to comment.