public
Description: An implementation of markdown in C, using a PEG grammar
Clone URL: git://github.com/jgm/peg-markdown.git
Search Repo:
Allow empty URLs and link text.
jgm (author)
Thu May 15 14:59:56 -0700 2008
commit  69e99275606f275137725dd647fdaf575d3bca0b
tree    cc4972206ae2e3670519965e275f88a9ed704493
parent  467b8f632996ea3c55d48723314b454e93c3b2ff
...
639
640
641
642
 
643
644
645
...
667
668
669
670
671
672
 
 
673
674
675
676
...
689
690
691
692
 
693
694
695
696
697
 
698
699
700
...
639
640
641
 
642
643
644
645
...
667
668
669
 
 
 
670
671
672
673
674
675
...
688
689
690
 
691
692
693
694
695
 
696
697
698
699
0
@@ -639,7 +639,7 @@
0
 
0
 ReferenceLink = ReferenceLinkDouble | ReferenceLinkSingle
0
 
0
-ReferenceLinkDouble = a:Label < Spnl > b:Label
0
+ReferenceLinkDouble = a:Label < Spnl > !"[]" b:Label
0
                        { link match;
0
                            if (find_reference(&match, b.children))
0
                                $$ = mk_link(a.children, match.url, match.title);
0
@@ -667,9 +667,8 @@
0
 Source = ( '<' < SourceContents > '>' | < SourceContents > )
0
           { $$ = mk_str(yytext); }
0
 
0
-SourceContents = ( ( !'(' !')' !'>' Nonspacechar )+
0
- | '(' SourceContents ')'
0
- )*
0
+SourceContents = ( ( !'(' !')' !'>' Nonspacechar )+ | '(' SourceContents ')')*
0
+ | ""
0
 
0
 Title = ( TitleSingle | TitleDouble | < "" > )
0
         { $$ = mk_str(yytext); }
0
0
@@ -689,12 +688,12 @@
0
                     $$ = mk_link(cons(mk_str(yytext), NULL), mailto, "");
0
                 }
0
 
0
-Reference = NonindentSpace l:Label ':' Spnl s:RefSrc Spnl t:RefTitle BlankLine*
0
+Reference = NonindentSpace !"[]" l:Label ':' Spnl s:RefSrc Spnl t:RefTitle BlankLine*
0
             { $$ = mk_link(l.children, s.contents.str, t.contents.str); $$.key = REFERENCE; }
0
 
0
 Label = '[' ( !'^' &{ extension(EXT_NOTES) } | &. &{ !extension(EXT_NOTES) } )
0
         a:StartList
0
- ( !']' Inline { pushelt($$, &a); } )+
0
+ ( !']' Inline { pushelt($$, &a); } )*
0
         ']'
0
         { $$ = mk_list(LIST, a); }
0
 

Comments

    No one has commented yet.