Skip to content

Commit

Permalink
Merge branch 'master' into mac-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher committed Aug 1, 2011
2 parents 7a5543d + c7b97dd commit 0b7d651
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 31 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
ALL : multimarkdown ALL : multimarkdown


VERSION=3.0.2 VERSION=3.1b1


PROGRAM=multimarkdown PROGRAM=multimarkdown


Expand Down Expand Up @@ -51,6 +51,10 @@ mmdtest: $(PROGRAM)
cd MarkdownTest; \ cd MarkdownTest; \
./MarkdownTest.pl --Script=../$(PROGRAM) --testdir=MultiMarkdownTests ./MarkdownTest.pl --Script=../$(PROGRAM) --testdir=MultiMarkdownTests


compattest: $(PROGRAM)
cd MarkdownTest; \
./MarkdownTest.pl --Script=../$(PROGRAM) --Tidy --testdir=CompatibilityTests --Flags="-c"

latextest: $(PROGRAM) latextest: $(PROGRAM)
cd MarkdownTest; \ cd MarkdownTest; \
./MarkdownTest.pl --Script=../$(PROGRAM) --testdir=MultiMarkdownTests --Flags="-t latex" --ext=".tex"; \ ./MarkdownTest.pl --Script=../$(PROGRAM) --testdir=MultiMarkdownTests --Flags="-t latex" --ext=".tex"; \
Expand Down
2 changes: 1 addition & 1 deletion MarkdownTest
Submodule MarkdownTest updated 55 files
+35 −0 CompatibilityTests/Automatic Labels.html
+45 −0 CompatibilityTests/Automatic Labels.text
+14 −0 CompatibilityTests/Base Header Level.html
+16 −0 CompatibilityTests/Base Header Level.text
+9 −0 CompatibilityTests/BibTeX.html
+10 −0 CompatibilityTests/BibTeX.text
+40 −0 CompatibilityTests/Citations.html
+42 −0 CompatibilityTests/Citations.text
+40 −0 CompatibilityTests/Definition Lists.html
+39 −0 CompatibilityTests/Definition Lists.text
+17 −0 CompatibilityTests/Dutch.html
+17 −0 CompatibilityTests/Dutch.text
+40 −0 CompatibilityTests/Email.html
+31 −0 CompatibilityTests/Email.text
+17 −0 CompatibilityTests/English.html
+17 −0 CompatibilityTests/English.text
+9 −0 CompatibilityTests/Errors.html
+11 −0 CompatibilityTests/Errors.text
+23 −0 CompatibilityTests/Footnotes.html
+25 −0 CompatibilityTests/Footnotes.text
+17 −0 CompatibilityTests/French.html
+17 −0 CompatibilityTests/French.text
+17 −0 CompatibilityTests/German.html
+17 −0 CompatibilityTests/German.text
+17 −0 CompatibilityTests/GermanGuillemets.html
+17 −0 CompatibilityTests/GermanGuillemets.text
+29 −0 CompatibilityTests/Glossary.html
+28 −0 CompatibilityTests/Glossary.text
+42 −0 CompatibilityTests/Headers.html
+51 −0 CompatibilityTests/Headers.text
+13 −0 CompatibilityTests/Line Breaks.html
+15 −0 CompatibilityTests/Line Breaks.text
+35 −0 CompatibilityTests/Link Attributes.html
+51 −0 CompatibilityTests/Link Attributes.text
+13 −0 CompatibilityTests/List Parsing.html
+11 −0 CompatibilityTests/List Parsing.text
+13 −0 CompatibilityTests/MarkdownInHTML.html
+19 −0 CompatibilityTests/MarkdownInHTML.text
+14 −0 CompatibilityTests/Math.html
+15 −0 CompatibilityTests/Math.text
+14 −0 CompatibilityTests/MetaData.html
+14 −0 CompatibilityTests/MetaData.text
+3 −0 CompatibilityTests/NotMetaData.html
+4 −0 CompatibilityTests/NotMetaData.text
+77 −0 CompatibilityTests/Sanity.html
+77 −0 CompatibilityTests/Sanity.text
+22 −0 CompatibilityTests/SmartQuotes.html
+22 −0 CompatibilityTests/SmartQuotes.text
+17 −0 CompatibilityTests/Swedish.html
+17 −0 CompatibilityTests/Swedish.text
+65 −0 CompatibilityTests/Tables.html
+71 −0 CompatibilityTests/Tables.text
+2 −2 MultiMarkdownTests/Citations.html
+3 −3 MultiMarkdownTests/Footnotes.html
+2 −2 MultiMarkdownTests/Glossary.html
2 changes: 1 addition & 1 deletion documentation
Submodule documentation updated from e038ec to 49395a
11 changes: 8 additions & 3 deletions markdown.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int extensions;
***********************************************************************/ ***********************************************************************/


#define VERSION "3.0.2" #define VERSION "3.1b1"
#define COPYRIGHT "portions Copyright (c) 2010-2011 Fletcher T. Penney.\n" \ #define COPYRIGHT "portions Copyright (c) 2010-2011 Fletcher T. Penney.\n" \
"original Copyright (c) 2008-2009 John MacFarlane. License GPLv2+ or MIT.\n" \ "original Copyright (c) 2008-2009 John MacFarlane. License GPLv2+ or MIT.\n" \
"This is free software: you are free to change and redistribute it.\n" \ "This is free software: you are free to change and redistribute it.\n" \
Expand Down Expand Up @@ -82,6 +82,7 @@ int main(int argc, char * argv[]) {
static gboolean opt_compatibility = FALSE; static gboolean opt_compatibility = FALSE;
static gboolean opt_batchmode = FALSE; static gboolean opt_batchmode = FALSE;
static gchar *opt_extract_meta = FALSE; static gchar *opt_extract_meta = FALSE;
static gboolean opt_no_labels = FALSE;


static GOptionEntry entries[] = static GOptionEntry entries[] =
{ {
Expand All @@ -105,6 +106,7 @@ int main(int argc, char * argv[]) {
{ "notes", 0, 0, G_OPTION_ARG_NONE, &opt_notes, "use notes extension (on by default)", NULL }, { "notes", 0, 0, G_OPTION_ARG_NONE, &opt_notes, "use notes extension (on by default)", NULL },
{ "nonotes", 0, 0, G_OPTION_ARG_NONE, &opt_no_notes, "do not use notes extension", NULL }, { "nonotes", 0, 0, G_OPTION_ARG_NONE, &opt_no_notes, "do not use notes extension", NULL },
{ "process-html", 0, 0, G_OPTION_ARG_NONE, &opt_process_html, "process MultiMarkdown inside of raw HTML", NULL }, { "process-html", 0, 0, G_OPTION_ARG_NONE, &opt_process_html, "process MultiMarkdown inside of raw HTML", NULL },
{ "nolabels", 0, 0, G_OPTION_ARG_NONE, &opt_no_labels, "do not look for possible cross-references - improves speed", NULL},
{ NULL } { NULL }
}; };


Expand Down Expand Up @@ -149,13 +151,16 @@ int main(int argc, char * argv[]) {
extensions = extensions | EXT_FILTER_HTML; extensions = extensions | EXT_FILTER_HTML;
if (opt_filter_styles) if (opt_filter_styles)
extensions = extensions | EXT_FILTER_STYLES; extensions = extensions | EXT_FILTER_STYLES;
if (opt_no_labels)
extensions = extensions | EXT_NO_LABELS;


/* Compatibility mode turns off extensions and most /* Compatibility mode turns off extensions and most
MultiMarkdown-specific features */ MultiMarkdown-specific features */
if (opt_compatibility) if (opt_compatibility) {
extensions = 0x000000; extensions = 0x000000;
if (opt_compatibility)
extensions = extensions | EXT_COMPATIBILITY; extensions = extensions | EXT_COMPATIBILITY;
extensions = extensions | EXT_NO_LABELS;
}


if (opt_to == NULL) if (opt_to == NULL)
output_format = HTML_FORMAT; output_format = HTML_FORMAT;
Expand Down
1 change: 1 addition & 0 deletions markdown_lib.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum markdown_extensions {
EXT_FILTER_STYLES = 0x08, EXT_FILTER_STYLES = 0x08,
EXT_COMPATIBILITY = 0x10, EXT_COMPATIBILITY = 0x10,
EXT_PROCESS_HTML = 0x20, EXT_PROCESS_HTML = 0x20,
EXT_NO_LABELS = 0x40,
}; };


enum markdown_formats { enum markdown_formats {
Expand Down
23 changes: 18 additions & 5 deletions markdown_output.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static bool html_footer = FALSE;
static int odf_type = 0; static int odf_type = 0;
static bool in_list = FALSE; static bool in_list = FALSE;
static bool no_latex_footnote = FALSE; static bool no_latex_footnote = FALSE;
static bool am_printing_html_footnote = FALSE;
static int footnote_counter_to_print = 0;


static void print_html_string(GString *out, char *str, bool obfuscate); static void print_html_string(GString *out, char *str, bool obfuscate);
static void print_html_element_list(GString *out, element *list, bool obfuscate); static void print_html_element_list(GString *out, element *list, bool obfuscate);
Expand Down Expand Up @@ -185,7 +187,7 @@ static void print_html_element(GString *out, element *elt, bool obfuscate) {
int lev; int lev;
char *label; char *label;
element *attribute; element *attribute;
element *locator; element *locator = NULL;
char *height; char *height;
char *width; char *width;
switch (elt->key) { switch (elt->key) {
Expand Down Expand Up @@ -258,7 +260,9 @@ static void print_html_element(GString *out, element *elt, bool obfuscate) {
(strcmp(elt->contents.link->identifier, "") == 0) ) { (strcmp(elt->contents.link->identifier, "") == 0) ) {
g_string_append_printf(out, "\""); g_string_append_printf(out, "\"");
} else { } else {
g_string_append_printf(out, "\" id=\"%s\"",elt->contents.link->identifier); if (!(extension(EXT_COMPATIBILITY))) {
g_string_append_printf(out, "\" id=\"%s\"",elt->contents.link->identifier);
}
} }
if (strlen(elt->contents.link->title) > 0) { if (strlen(elt->contents.link->title) > 0) {
g_string_append_printf(out, " title=\""); g_string_append_printf(out, " title=\"");
Expand Down Expand Up @@ -344,6 +348,12 @@ static void print_html_element(GString *out, element *elt, bool obfuscate) {
pad(out, 2); pad(out, 2);
g_string_append_printf(out, "<p>"); g_string_append_printf(out, "<p>");
print_html_element_list(out, elt->children, obfuscate); print_html_element_list(out, elt->children, obfuscate);
if (am_printing_html_footnote && ( elt->next == NULL)) {
g_string_append_printf(out, " <a href=\"#fnref:%d\" title=\"return to article\" class=\"reversefootnote\">&#160;&#8617;</a>", footnote_counter_to_print);
/* Only print once. For now, it's the first paragraph, until
I can figure out to make it the last paragraph */
am_printing_html_footnote = FALSE;
}
g_string_append_printf(out, "</p>"); g_string_append_printf(out, "</p>");
padded = 0; padded = 0;
break; break;
Expand Down Expand Up @@ -719,8 +729,11 @@ static void print_html_endnotes(GString *out) {
} else { } else {
g_string_append_printf(out, "<li id=\"fn:%d\">\n", counter); g_string_append_printf(out, "<li id=\"fn:%d\">\n", counter);
padded = 2; padded = 2;
am_printing_html_footnote = TRUE;
footnote_counter_to_print = counter;
print_html_element_list(out, note_elt, false); print_html_element_list(out, note_elt, false);
g_string_append_printf(out, " <a href=\"#fnref:%d\" title=\"return to article\" class=\"reversefootnote\">&#160;&#8617;</a>", counter); am_printing_html_footnote = FALSE;
footnote_counter_to_print = 0;
pad(out, 1); pad(out, 1);
g_string_append_printf(out, "</li>"); g_string_append_printf(out, "</li>");
} }
Expand Down Expand Up @@ -1202,7 +1215,7 @@ static void print_latex_element(GString *out, element *elt) {
} }
} }
} }
if (elt->children->contents.str == NULL) { if ((elt->children != NULL) && (elt->children->contents.str == NULL)) {
elt->children->contents.str = strdup(elt->contents.str); elt->children->contents.str = strdup(elt->contents.str);
add_endnote(elt->children); add_endnote(elt->children);
} }
Expand Down Expand Up @@ -1705,7 +1718,7 @@ void print_odf_element(GString *out, element *elt) {
char *label; char *label;
char *height; char *height;
char *width; char *width;
element *locator; element *locator = NULL;
int old_type = 0; int old_type = 0;
switch (elt->key) { switch (elt->key) {
case SPACE: case SPACE:
Expand Down
52 changes: 32 additions & 20 deletions markdown_parser.leg
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@ MetaDataKeyValue = a:MetaDataKey
$$->children = b; $$->children = b;
} }


MetaDataKey = < AlphanumericAscii ( Sp ( AlphanumericAscii | '_' | ' ' | '-')+)* > MetaDataKey = < !([A-Za-z]+ "://") AlphanumericAscii ( Sp ( AlphanumericAscii | '_' | ' ' | '-')+)* >
{ {
char *label = label_from_string(yytext,0); char *label = label_from_string(yytext,0);
$$ = mk_str(label); $$ = mk_str(label);
free(label); free(label);
$$->key = METAKEY; $$->key = METAKEY;
} }


SingleLineMetaKeyValue = MetaDataKey Sp ':' Sp (!Newline .)*

MetaDataValue = a:StartList MetaDataValue = a:StartList
((< (!Newline .)* > { a = cons(mk_str(yytext), a); }) ((< (!Newline .)* > { a = cons(mk_str(yytext), a); })
((Newline &(!BlankLine !MetaDataKeyValue Sp RawLine)) ((Newline &(!BlankLine !SingleLineMetaKeyValue Sp RawLine))
{ a = cons(mk_str("\n"), a);} | Newline) { a = cons(mk_str("\n"), a);} | Newline)
(!BlankLine !MetaDataKeyValue Sp RawLine (!BlankLine !SingleLineMetaKeyValue Sp RawLine
{ a = cons(mk_str(yytext), a);} )* ) { a = cons(mk_str(yytext), a);} )* )
{ $$ = mk_str_from_list(a,false); { $$ = mk_str_from_list(a,false);
trim_trailing_whitespace($$->contents.str); trim_trailing_whitespace($$->contents.str);
Expand All @@ -82,8 +84,8 @@ MetaDataValue = a:StartList
Block = BlankLine* Block = BlankLine*
( BlockQuote ( BlockQuote
| Verbatim | Verbatim
| DefinitionList | &{ !extension(EXT_COMPATIBILITY) } DefinitionList
| Glossary | &{ !extension(EXT_COMPATIBILITY) } Glossary
| Note | Note
| Reference | Reference
| HorizontalRule | HorizontalRule
Expand All @@ -92,7 +94,7 @@ Block = BlankLine*
| BulletList | BulletList
| HtmlBlock | HtmlBlock
| StyleBlock | StyleBlock
| Table | &{ !extension(EXT_COMPATIBILITY) } Table
| &{ !extension(EXT_COMPATIBILITY) } ImageBlock | &{ !extension(EXT_COMPATIBILITY) } ImageBlock
| !(Sp? HtmlBlockOpenDiv) Para | !(Sp? HtmlBlockOpenDiv) Para
| Plain ) | Plain )
Expand All @@ -102,16 +104,16 @@ HeadingSectionBlock =
!Heading !Heading
( BlockQuote ( BlockQuote
| Verbatim | Verbatim
| DefinitionList | &{ !extension(EXT_COMPATIBILITY) } DefinitionList
| Glossary | &{ !extension(EXT_COMPATIBILITY) } Glossary
| Note | Note
| Reference | Reference
| HorizontalRule | HorizontalRule
| OrderedList | OrderedList
| BulletList | BulletList
| HtmlBlock | HtmlBlock
| StyleBlock | StyleBlock
| Table | &{ !extension(EXT_COMPATIBILITY) } Table
| &{ !extension(EXT_COMPATIBILITY) } ImageBlock | &{ !extension(EXT_COMPATIBILITY) } ImageBlock
| !(Sp? HtmlBlockOpenDiv) Para | !(Sp? HtmlBlockOpenDiv) Para
| Plain ) | Plain )
Expand Down Expand Up @@ -460,17 +462,17 @@ Inlines = a:StartList ( !Endline Inline { a = cons($$, a); }
{ $$ = mk_list(LIST, a); } { $$ = mk_list(LIST, a); }


Inline = Str Inline = Str
| MathSpan | &{ !extension(EXT_COMPATIBILITY) } MathSpan
| Endline | Endline
| UlOrStarLine | UlOrStarLine
| Space | Space
| Strong | Strong
| Emph | Emph
| CitationReference | &{ !extension(EXT_COMPATIBILITY) } CitationReference
| Image | Image
| Link | Link
| NoteReference | NoteReference
# | InlineNote # Not used in MultiMarkdown # | InlineNote # Not used in Markdown/MultiMarkdown
| Code | Code
| MarkdownHtmlTagOpen | MarkdownHtmlTagOpen
| RawHtml | RawHtml
Expand Down Expand Up @@ -663,7 +665,10 @@ AutoLinkEmail = '<' ( "mailto:" )? < [-A-Za-z0-9+_]+ '@' ( !Newline !'>' . )+ >
} }


Reference = a:StartList NonindentSpace !"[]" l:Label ':' Spnl s:RefSrc Reference = a:StartList NonindentSpace !"[]" l:Label ':' Spnl s:RefSrc
t:RefTitle (Attributes { a = cons($$,a);})? BlankLine+ t:RefTitle
( &{ !extension(EXT_COMPATIBILITY) }
(Attributes { a = cons($$,a);})? )?
BlankLine+
{ {
char *label; char *label;
GString *text = g_string_new(""); GString *text = g_string_new("");
Expand Down Expand Up @@ -728,11 +733,14 @@ RefTitle = ( RefTitleSingle | RefTitleDouble | RefTitleParens | EmptyTitle )


EmptyTitle = < "" > EmptyTitle = < "" >


RefTitleSingle = Spnl '\'' < ( !( '\'' Sp Newline | Newline | '\'' Sp AlphanumericAscii+ '=' ) . )* > '\'' RefTitleSingle = Spnl '\'' < ( !( '\'' Sp Newline | Newline |
&{ !extension(EXT_COMPATIBILITY) } '\'' Sp AlphanumericAscii+ '=' ) . )* > '\''


RefTitleDouble = Spnl '"' < ( !('"' Sp Newline | Newline | '"' Sp AlphanumericAscii+ '=' ) . )* > '"' RefTitleDouble = Spnl '"' < ( !('"' Sp Newline | Newline |
&{ !extension(EXT_COMPATIBILITY) } '"' Sp AlphanumericAscii+ '=' ) . )* > '"'


RefTitleParens = Spnl '(' < ( !(')' Sp Newline | Newline | ')' Sp AlphanumericAscii+ '=' ) . )* > ')' RefTitleParens = Spnl '(' < ( !(')' Sp Newline | Newline |
&{ !extension(EXT_COMPATIBILITY) } ')' Sp AlphanumericAscii+ '=' ) . )* > ')'


References = a:StartList References = a:StartList
( b:Reference { a = cons(b, a); } | SkipBlock )* ( b:Reference { a = cons(b, a); } | SkipBlock )*
Expand Down Expand Up @@ -773,7 +781,7 @@ Nonspacechar = !Spacechar !Newline .
Newline = '\n' | '\r' '\n'? Newline = '\n' | '\r' '\n'?
Sp = Spacechar* Sp = Spacechar*
Spnl = Sp (Newline Sp)? Spnl = Sp (Newline Sp)?
SpecialChar = '*' | '_' | '`' | '&' | '[' | ']' | '(' | ')' | '<' | '!' | '#' | '\\' | ExtendedSpecialChar SpecialChar = '*' | '_' | '`' | '&' | '[' | ']' | '(' | ')' | '<' | '!' | '#' | '\\' | '\'' | '"' | ExtendedSpecialChar
NormalChar = !( SpecialChar | Spacechar | Newline ) . NormalChar = !( SpecialChar | Spacechar | Newline ) .
NonAlphanumeric = [\000-\057\072-\100\133-\140\173-\177] NonAlphanumeric = [\000-\057\072-\100\133-\140\173-\177]
Alphanumeric = [0-9A-Za-z] | '\200' | '\201' | '\202' | '\203' | '\204' | '\205' | '\206' | '\207' | '\210' | '\211' | '\212' | '\213' | '\214' | '\215' | '\216' | '\217' | '\220' | '\221' | '\222' | '\223' | '\224' | '\225' | '\226' | '\227' | '\230' | '\231' | '\232' | '\233' | '\234' | '\235' | '\236' | '\237' | '\240' | '\241' | '\242' | '\243' | '\244' | '\245' | '\246' | '\247' | '\250' | '\251' | '\252' | '\253' | '\254' | '\255' | '\256' | '\257' | '\260' | '\261' | '\262' | '\263' | '\264' | '\265' | '\266' | '\267' | '\270' | '\271' | '\272' | '\273' | '\274' | '\275' | '\276' | '\277' | '\300' | '\301' | '\302' | '\303' | '\304' | '\305' | '\306' | '\307' | '\310' | '\311' | '\312' | '\313' | '\314' | '\315' | '\316' | '\317' | '\320' | '\321' | '\322' | '\323' | '\324' | '\325' | '\326' | '\327' | '\330' | '\331' | '\332' | '\333' | '\334' | '\335' | '\336' | '\337' | '\340' | '\341' | '\342' | '\343' | '\344' | '\345' | '\346' | '\347' | '\350' | '\351' | '\352' | '\353' | '\354' | '\355' | '\356' | '\357' | '\360' | '\361' | '\362' | '\363' | '\364' | '\365' | '\366' | '\367' | '\370' | '\371' | '\372' | '\373' | '\374' | '\375' | '\376' | '\377' Alphanumeric = [0-9A-Za-z] | '\200' | '\201' | '\202' | '\203' | '\204' | '\205' | '\206' | '\207' | '\210' | '\211' | '\212' | '\213' | '\214' | '\215' | '\216' | '\217' | '\220' | '\221' | '\222' | '\223' | '\224' | '\225' | '\226' | '\227' | '\230' | '\231' | '\232' | '\233' | '\234' | '\235' | '\236' | '\237' | '\240' | '\241' | '\242' | '\243' | '\244' | '\245' | '\246' | '\247' | '\250' | '\251' | '\252' | '\253' | '\254' | '\255' | '\256' | '\257' | '\260' | '\261' | '\262' | '\263' | '\264' | '\265' | '\266' | '\267' | '\270' | '\271' | '\272' | '\273' | '\274' | '\275' | '\276' | '\277' | '\300' | '\301' | '\302' | '\303' | '\304' | '\305' | '\306' | '\307' | '\310' | '\311' | '\312' | '\313' | '\314' | '\315' | '\316' | '\317' | '\320' | '\321' | '\322' | '\323' | '\324' | '\325' | '\326' | '\327' | '\330' | '\331' | '\332' | '\333' | '\334' | '\335' | '\336' | '\337' | '\340' | '\341' | '\342' | '\343' | '\344' | '\345' | '\346' | '\347' | '\350' | '\351' | '\352' | '\353' | '\354' | '\355' | '\356' | '\357' | '\360' | '\361' | '\362' | '\363' | '\364' | '\365' | '\366' | '\367' | '\370' | '\371' | '\372' | '\373' | '\374' | '\375' | '\376' | '\377'
Expand Down Expand Up @@ -985,7 +993,8 @@ RawCitationReference = "[#" < ( !Newline !']' . )+ > ']'
{ $$ = mk_str(yytext); } { $$ = mk_str(yytext); }




AutoLabels = a:StartList ( b:Heading AutoLabels = ( &{ !extension(EXT_COMPATIBILITY) && !extension(EXT_NO_LABELS)}
a:StartList ( b:Heading
{ {
GString *label = g_string_new(""); GString *label = g_string_new("");
char *lab; char *lab;
Expand Down Expand Up @@ -1026,9 +1035,10 @@ AutoLabels = a:StartList ( b:Heading
g_string_free(label,true); g_string_free(label,true);
free_element_list(c);} free_element_list(c);}
| SkipBlock )* | SkipBlock )*
{ labels = a; } { labels = a; })


DefinitionList = a:StartList ( DefinitionList = a:StartList &(TermLine+ ':')
(
(Term { a = cons($$, a); } )+ (Term { a = cons($$, a); } )+
(Definition { a = cons($$, a);})+ (Definition { a = cons($$, a);})+
BlankLine* BlankLine*
Expand All @@ -1037,6 +1047,8 @@ DefinitionList = a:StartList (
$$->key = DEFLIST; $$->key = DEFLIST;
} }


TermLine = !':' !BlankLine (!Newline .)* Newline

Term = a:StartList !BlankLine !':' Term = a:StartList !BlankLine !':'
(!Newline !Endline Inline {a = cons($$, a);} )+ Newline (!Newline !Endline Inline {a = cons($$, a);} )+ Newline
{ {
Expand Down

0 comments on commit 0b7d651

Please sign in to comment.