]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Initial abbreviation support
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 5 Mar 2017 04:10:51 +0000 (23:10 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 5 Mar 2017 04:10:51 +0000 (23:10 -0500)
16 files changed:
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/latex.c
Sources/libMultiMarkdown/lexer.c
Sources/libMultiMarkdown/lexer.re
Sources/libMultiMarkdown/mmd.c
Sources/libMultiMarkdown/odf.c
Sources/libMultiMarkdown/parser.c
Sources/libMultiMarkdown/parser.out
Sources/libMultiMarkdown/parser.y
Sources/libMultiMarkdown/scanners.c
Sources/libMultiMarkdown/scanners.re
Sources/libMultiMarkdown/writer.c
Sources/libMultiMarkdown/writer.h
tests/MMD6Tests/Abbreviations.html [new file with mode: 0644]
tests/MMD6Tests/Abbreviations.htmlc [new file with mode: 0644]
tests/MMD6Tests/Abbreviations.tex [new file with mode: 0644]

index 15ab36d99c791b7ad5c982d84a9a8dd1399b153f..2726c1ec7345d43ffffa1d03f25caaf6505fff10 100644 (file)
@@ -808,6 +808,9 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                case BRACKET_LEFT:
                        print_const("[");                       
                        break;
+               case BRACKET_ABBREVIATION_LEFT:
+                       print_const("[>");
+                       break;
                case BRACKET_CITATION_LEFT:
                        print_const("[#");
                        break;
@@ -1089,6 +1092,31 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                        // No links exist, so treat as normal
                        mmd_export_token_tree_html(out, source, t->child, scratch);
                        break;
+               case PAIR_BRACKET_ABBREVIATION:
+                       if (scratch->extensions & EXT_COMPATIBILITY) {
+                               mmd_export_token_tree_html(out, source, t->child, scratch);
+                       } else {
+                               abbreviation_from_bracket(source, scratch, t, &temp_short);
+
+                               if (temp_short == -1) {
+                                       print_const("[>");
+                                       mmd_export_token_tree_html(out, source, t->child, scratch);
+                                       print_char(']');
+                                       break;
+                               }
+
+                               temp_note = stack_peek_index(scratch->used_abbreviations, temp_short - 1);
+
+                               t->child->type = TEXT_EMPTY;
+                               t->child->mate->type = TEXT_EMPTY;
+                               
+                               print_const("<abbr title=\"");
+                               mmd_print_string_html(out, temp_note->clean_text, false);
+                               print_const("\">");
+                               mmd_export_token_tree_html(out, source, t->child, scratch);
+                               print_const("</abbr>");                         
+                       }
+                       break;
                case PAIR_BRACKET_CITATION:
                        parse_citation:
                        temp_bool = true;
index 32996f9cfc2362792debd0a5dbdd235d1fe60dee..e78402bc715e5fd24c7d231b78c3cc579e12e135 100644 (file)
@@ -1011,6 +1011,24 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        // No links exist, so treat as normal
                        mmd_export_token_tree_latex(out, source, t->child, scratch);
                        break;
+               case PAIR_BRACKET_ABBREVIATION:
+                       if (scratch->extensions & EXT_COMPATIBILITY) {
+                               mmd_export_token_tree_latex(out, source, t->child, scratch);
+                       } else {
+                               abbreviation_from_bracket(source, scratch, t, &temp_short);
+
+                               if (temp_short == -1) {
+                                       print_const("[>");
+                                       mmd_export_token_tree_latex(out, source, t->child, scratch);
+                                       print_char(']');
+                                       break;
+                               }
+
+                               temp_note = stack_peek_index(scratch->used_abbreviations, temp_short - 1);
+
+                               printf("\\gls{%s}", temp_note->label_text);
+                       }
+                       break;
                case PAIR_BRACKET_CITATION:
                        parse_citation:
                        temp_bool = true;   // Track whether this is a 'not cited'
@@ -1617,6 +1635,19 @@ void mmd_define_glossaries_latex(DString * out, const char * source, scratch_pad
                mmd_export_token_tree_latex(out, source, f->note->content, scratch);
                print_const("}\n\n");
        }
+
+       // And abbreviations
+
+       HASH_ITER(hh, scratch->abbreviation_hash, f, f_tmp) {
+               // Add this abbreviation definition
+               print_const("\\newacronym{");
+               print(f->note->label_text);
+               print_const("}{");
+               print(f->note->label_text);
+               print_const("}{");
+               print(f->note->clean_text);
+               print_const("}\n\n");
+       }
 }
 
 
index f668de9d39a068981c6c4b1bdcaa6574576a0563..b52fed1a2b65d7b103ae79863f47301b15f6e772 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.14.3 on Thu Mar  2 09:54:28 2017 */
+/* Generated by re2c 0.14.3 on Sat Mar  4 20:43:39 2017 */
 /**
 
        MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more.
@@ -132,12 +132,12 @@ yy2:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '+':       goto yy267;
-       case '-':       goto yy266;
-       case '=':       goto yy263;
-       case '>':       goto yy265;
-       case '{':       goto yy261;
-       case '~':       goto yy264;
+       case '+':       goto yy269;
+       case '-':       goto yy268;
+       case '=':       goto yy265;
+       case '>':       goto yy267;
+       case '{':       goto yy263;
+       case '~':       goto yy266;
        default:        goto yy3;
        }
 yy3:
@@ -146,7 +146,7 @@ yy4:
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '+':       goto yy258;
+       case '+':       goto yy260;
        default:        goto yy5;
        }
 yy5:
@@ -154,7 +154,7 @@ yy5:
 yy6:
        ++YYCURSOR;
        switch ((yych = *YYCURSOR)) {
-       case '-':       goto yy252;
+       case '-':       goto yy254;
        default:        goto yy7;
        }
 yy7:
@@ -163,7 +163,7 @@ yy8:
        yyaccept = 2;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '<':       goto yy249;
+       case '<':       goto yy251;
        default:        goto yy9;
        }
 yy9:
@@ -172,8 +172,8 @@ yy10:
        yyaccept = 3;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '>':       goto yy245;
-       case '~':       goto yy244;
+       case '>':       goto yy247;
+       case '~':       goto yy246;
        default:        goto yy11;
        }
 yy11:
@@ -182,7 +182,7 @@ yy12:
        yyaccept = 4;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '=':       goto yy241;
+       case '=':       goto yy243;
        default:        goto yy13;
        }
 yy13:
@@ -190,10 +190,11 @@ yy13:
 yy14:
        ++YYCURSOR;
        switch ((yych = *YYCURSOR)) {
-       case '#':       goto yy235;
+       case '#':       goto yy239;
        case '%':       goto yy233;
-       case '?':       goto yy237;
-       case '^':       goto yy239;
+       case '>':       goto yy241;
+       case '?':       goto yy235;
+       case '^':       goto yy237;
        default:        goto yy15;
        }
 yy15:
@@ -433,7 +434,7 @@ yy70:
        case 7:         goto yy49;
        case 8:         goto yy127;
        case 9:         goto yy215;
-       default:        goto yy262;
+       default:        goto yy264;
        }
 yy71:
        YYCTXMARKER = YYCURSOR + 1;
@@ -944,146 +945,149 @@ yy233:
        { return BRACKET_VARIABLE_LEFT; }
 yy235:
        ++YYCURSOR;
-       { return BRACKET_CITATION_LEFT; }
+       { return BRACKET_GLOSSARY_LEFT; }
 yy237:
        ++YYCURSOR;
-       { return BRACKET_GLOSSARY_LEFT; }
+       { return BRACKET_FOOTNOTE_LEFT; }
 yy239:
        ++YYCURSOR;
-       { return BRACKET_FOOTNOTE_LEFT; }
+       { return BRACKET_CITATION_LEFT; }
 yy241:
+       ++YYCURSOR;
+       { return BRACKET_ABBREVIATION_LEFT; }
+yy243:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '}':       goto yy242;
+       case '}':       goto yy244;
        default:        goto yy70;
        }
-yy242:
+yy244:
        ++YYCURSOR;
        { return CRITIC_HI_CLOSE; }
-yy244:
+yy246:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '}':       goto yy247;
+       case '}':       goto yy249;
        default:        goto yy70;
        }
-yy245:
+yy247:
        ++YYCURSOR;
        { return CRITIC_SUB_DIV; }
-yy247:
+yy249:
        ++YYCURSOR;
        { return CRITIC_SUB_CLOSE; }
-yy249:
+yy251:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '}':       goto yy250;
+       case '}':       goto yy252;
        default:        goto yy70;
        }
-yy250:
+yy252:
        ++YYCURSOR;
        { return CRITIC_COM_CLOSE; }
-yy252:
+yy254:
        ++YYCURSOR;
        switch ((yych = *YYCURSOR)) {
-       case '-':       goto yy256;
-       case '}':       goto yy254;
-       default:        goto yy253;
+       case '-':       goto yy258;
+       case '}':       goto yy256;
+       default:        goto yy255;
        }
-yy253:
+yy255:
        { return DASH_N; }
-yy254:
+yy256:
        ++YYCURSOR;
        { return CRITIC_DEL_CLOSE; }
-yy256:
+yy258:
        ++YYCURSOR;
        { return DASH_M; }
-yy258:
+yy260:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '}':       goto yy259;
+       case '}':       goto yy261;
        default:        goto yy70;
        }
-yy259:
+yy261:
        ++YYCURSOR;
        { return CRITIC_ADD_CLOSE; }
-yy261:
+yy263:
        yyaccept = 10;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case 'T':       goto yy278;
-       default:        goto yy262;
+       case 'T':       goto yy280;
+       default:        goto yy264;
        }
-yy262:
+yy264:
        { return BRACE_DOUBLE_LEFT; }
-yy263:
+yy265:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '=':       goto yy276;
+       case '=':       goto yy278;
        default:        goto yy70;
        }
-yy264:
+yy266:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '~':       goto yy274;
+       case '~':       goto yy276;
        default:        goto yy70;
        }
-yy265:
+yy267:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '>':       goto yy272;
+       case '>':       goto yy274;
        default:        goto yy70;
        }
-yy266:
+yy268:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '-':       goto yy270;
+       case '-':       goto yy272;
        default:        goto yy70;
        }
-yy267:
+yy269:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '+':       goto yy268;
+       case '+':       goto yy270;
        default:        goto yy70;
        }
-yy268:
+yy270:
        ++YYCURSOR;
        { return CRITIC_ADD_OPEN; }
-yy270:
+yy272:
        ++YYCURSOR;
        { return CRITIC_DEL_OPEN; }
-yy272:
+yy274:
        ++YYCURSOR;
        { return CRITIC_COM_OPEN; }
-yy274:
+yy276:
        ++YYCURSOR;
        { return CRITIC_SUB_OPEN; }
-yy276:
+yy278:
        ++YYCURSOR;
        { return CRITIC_HI_OPEN; }
-yy278:
+yy280:
        yych = *++YYCURSOR;
        switch (yych) {
-       case 'O':       goto yy279;
+       case 'O':       goto yy281;
        default:        goto yy70;
        }
-yy279:
+yy281:
        yych = *++YYCURSOR;
        switch (yych) {
-       case 'C':       goto yy280;
+       case 'C':       goto yy282;
        default:        goto yy70;
        }
-yy280:
+yy282:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '}':       goto yy281;
+       case '}':       goto yy283;
        default:        goto yy70;
        }
-yy281:
+yy283:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '}':       goto yy282;
+       case '}':       goto yy284;
        default:        goto yy70;
        }
-yy282:
+yy284:
        ++YYCURSOR;
        { return TOC; }
 }
index 4ab32a1dac2142456ec5b87d31ab67d901afc928..9729c1957a41dbf32d699d3df0a71e7eaa6878a6 100644 (file)
@@ -114,9 +114,10 @@ int scan(Scanner * s, const char * stop) {
                "]"                                                             { return BRACKET_RIGHT; }
 
                "!["                                                    { return BRACKET_IMAGE_LEFT; }
+               "[>"                                                    { return BRACKET_ABBREVIATION_LEFT; }
+               "[#"                                                    { return BRACKET_CITATION_LEFT; }
                "[^"                                                    { return BRACKET_FOOTNOTE_LEFT; }
                "[?"                                                    { return BRACKET_GLOSSARY_LEFT; }
-               "[#"                                                    { return BRACKET_CITATION_LEFT; }
                "[%"                                                    { return BRACKET_VARIABLE_LEFT; }
 
                "("                                                             { return PAREN_LEFT; }
index 4da3ad2f31f8538a4245a6a00a1fde2e55f51267..f87694afaf47f40c1c3753102a7aff5486740dd4 100644 (file)
@@ -129,13 +129,14 @@ mmd_engine * mmd_engine_create(DString * d, unsigned long extensions) {
                        token_pair_engine_add_pairing(e->pairings2, BRACKET_CITATION_LEFT, BRACKET_RIGHT, PAIR_BRACKET_CITATION, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                        token_pair_engine_add_pairing(e->pairings2, BRACKET_FOOTNOTE_LEFT, BRACKET_RIGHT, PAIR_BRACKET_FOOTNOTE, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                        token_pair_engine_add_pairing(e->pairings2, BRACKET_GLOSSARY_LEFT, BRACKET_RIGHT, PAIR_BRACKET_GLOSSARY, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
+                       token_pair_engine_add_pairing(e->pairings2, BRACKET_ABBREVIATION_LEFT, BRACKET_RIGHT, PAIR_BRACKET_ABBREVIATION, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                } else {
                        token_pair_engine_add_pairing(e->pairings2, BRACKET_CITATION_LEFT, BRACKET_RIGHT, PAIR_BRACKET, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                        token_pair_engine_add_pairing(e->pairings2, BRACKET_FOOTNOTE_LEFT, BRACKET_RIGHT, PAIR_BRACKET, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                        token_pair_engine_add_pairing(e->pairings2, BRACKET_GLOSSARY_LEFT, BRACKET_RIGHT, PAIR_BRACKET, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
+                       token_pair_engine_add_pairing(e->pairings2, BRACKET_ABBREVIATION_LEFT, BRACKET_RIGHT, PAIR_BRACKET, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                }
                
-               token_pair_engine_add_pairing(e->pairings2, BRACKET_ABBREVIATION_LEFT, BRACKET_RIGHT, PAIR_BRACKET_ABBREVIATION, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
                token_pair_engine_add_pairing(e->pairings2, BRACKET_VARIABLE_LEFT, BRACKET_RIGHT, PAIR_BRACKET_VARIABLE, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
 
                token_pair_engine_add_pairing(e->pairings2, BRACKET_IMAGE_LEFT, BRACKET_RIGHT, PAIR_BRACKET_IMAGE, PAIRING_ALLOW_EMPTY | PAIRING_PRUNE_MATCH);
@@ -469,17 +470,6 @@ void mmd_assign_line_type(mmd_engine * e, token * line) {
                                break;
                        }
                case STAR:
-                       if (!(e->extensions & EXT_COMPATIBILITY)) {
-                               if (line->child->next && line->child->next->type == BRACKET_LEFT) {
-                                       // Possible Abbreviation definition
-                                       if (scan_ref_abbreviation(&source[line->child->start])) {
-                                               line->type = LINE_DEF_ABBREVIATION;
-                                               line->child->type = TEXT_EMPTY;
-                                               line->child->next->type = BRACKET_ABBREVIATION_LEFT;
-                                               break;
-                                       }
-                               }
-                       }
                case UL:
                        // Could this be a horizontal rule?
                        t = line->child->next;
@@ -599,6 +589,15 @@ void mmd_assign_line_type(mmd_engine * e, token * line) {
                                line->type = (scan_len) ? LINE_DEF_LINK : LINE_PLAIN;
                        }
                        break;
+               case BRACKET_ABBREVIATION_LEFT:
+                       if (e->extensions & EXT_NOTES) {
+                               scan_len = scan_ref_abbreviation(&source[line->start]);
+                               line->type = (scan_len) ? LINE_DEF_ABBREVIATION : LINE_PLAIN;
+                       } else {
+                               scan_len = scan_ref_link_no_attributes(&source[line->start]);
+                               line->type = (scan_len) ? LINE_DEF_LINK : LINE_PLAIN;
+                       }
+                       break;
                case BRACKET_CITATION_LEFT:
                        if (e->extensions & EXT_NOTES) {
                                scan_len = scan_ref_citation(&source[line->start]);
index 6d9a898fd648edc0c2bcee803ca1dbf61705fddd..36dc77f69d613f799264f39f9083f2004bc03f4f 100644 (file)
@@ -1066,6 +1066,43 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
                                mmd_export_token_tree_odf(out, source, t->child, scratch);
                        }
                        break;
+               case PAIR_BRACKET_ABBREVIATION:
+                       if (scratch->extensions & EXT_NOTES) {
+                               abbreviation_from_bracket(source, scratch, t, &temp_short);
+
+                               if (temp_short == -1) {
+                                       print_const("[>");
+                                       mmd_export_token_tree_odf(out, source, t->child, scratch);
+                                       print_const("]");
+                                       break;
+                               }
+
+                               temp_short2 = scratch->odf_para_type;
+                               scratch->odf_para_type = PAIR_BRACKET_ABBREVIATION;
+
+                               if (temp_short < scratch->used_abbreviations->size) {
+                                       // Re-using previous footnote
+                                       print("\\footnote{reuse");
+
+                                       print("}");
+                               } else {
+                                       // This is a new abbreviation item
+                                       temp_note = stack_peek_index(scratch->used_abbreviations, temp_short - 1);
+
+                                       mmd_print_string_odf(out, temp_note->label_text); 
+
+                                       printf("<text:note text:id=\"gn%d\" text:note-class=\"glossary\"><text:note-body>", temp_short);
+
+                                       mmd_export_token_tree_odf(out, source, temp_note->content, scratch);
+                                       print_const("</text:note-body></text:note>");
+                               }
+
+                               scratch->odf_para_type = temp_short2;
+                       } else {
+                               // Footnotes disabled
+                               mmd_export_token_tree_odf(out, source, t->child, scratch);
+                       }
+                       break;
                case PAIR_BRACKET_GLOSSARY:
                        if (scratch->extensions & EXT_NOTES) {
                                glossary_from_bracket(source, scratch, t, &temp_short);
index 1635e50c9652a7136b8d5d72b98fa32d9aa0fe56..8c4cd99664c8c42c6e9f87ef0c8c7b2e3867f98c 100644 (file)
@@ -107,16 +107,16 @@ typedef union {
 #define ParseARG_FETCH  mmd_engine * engine  = yypParser->engine 
 #define ParseARG_STORE yypParser->engine  = engine 
 #define YYFALLBACK 1
-#define YYNSTATE             42
-#define YYNRULE              134
-#define YY_MAX_SHIFT         41
-#define YY_MIN_SHIFTREDUCE   136
-#define YY_MAX_SHIFTREDUCE   269
-#define YY_MIN_REDUCE        270
-#define YY_MAX_REDUCE        403
-#define YY_ERROR_ACTION      404
-#define YY_ACCEPT_ACTION     405
-#define YY_NO_ACTION         406
+#define YYNSTATE             44
+#define YYNRULE              135
+#define YY_MAX_SHIFT         43
+#define YY_MIN_SHIFTREDUCE   137
+#define YY_MAX_SHIFTREDUCE   271
+#define YY_MIN_REDUCE        272
+#define YY_MAX_REDUCE        406
+#define YY_ERROR_ACTION      407
+#define YY_ACCEPT_ACTION     408
+#define YY_NO_ACTION         409
 /************* End control #defines *******************************************/
 
 /* Define the yytestcase() macro to be a no-op if is not already defined
@@ -190,34 +190,34 @@ typedef union {
 *********** Begin parsing tables **********************************************/
 #define YY_ACTTAB_COUNT (278)
 static const YYACTIONTYPE yy_action[] = {
- /*     0 */   405,    1,  138,   31,  148,  149,  150,  151,  152,  153,
- /*    10 */    41,  155,   30,   28,   38,   36,   29,   14,  162,  163,
- /*    20 */   164,   40,  216,   13,   13,   28,  239,  225,  226,  268,
- /*    30 */    33,   33,   26,  264,   25,   24,   40,   38,   36,  219,
- /*    40 */     8,  222,   39,  191,   15,   15,  270,  145,  268,  180,
- /*    50 */    16,  268,  264,  225,  226,  264,  253,  139,  140,  141,
- /*    60 */   142,  143,  144,  230,    7,    6,  237,    4,    3,    2,
- /*    70 */    17,   27,  217,  146,    5,  239,  241,  244,  247,  242,
- /*    80 */   245,  248,  259,  145,  222,  166,   16,  268,  187,  225,
- /*    90 */   226,  264,  253,  139,  140,  141,  142,  143,  144,  230,
- /*   100 */     7,    6,  237,    4,    3,    2,   17,  239,  261,  146,
- /*   110 */     5,  239,  241,  244,  247,  242,  245,  248,  259,  137,
- /*   120 */    31,  148,  149,  150,  151,  152,  153,   41,  155,   30,
- /*   130 */    28,   38,   36,   29,   14,  162,  163,  164,  260,  251,
- /*   140 */   252,  184,   28,  249,   35,   35,  254,   33,   33,   26,
- /*   150 */   255,   25,   24,   22,   38,   36,  214,    8,  197,   39,
- /*   160 */   215,   15,   15,  209,  211,  212,  250,  192,  194,  190,
- /*   170 */   193,  195,  251,  252,   27,  196,  249,    9,   40,    9,
- /*   180 */    13,   13,   32,   32,  171,   10,   10,   18,   18,  165,
- /*   190 */     5,  174,  174,   34,   34,  232,   27,   37,   37,  250,
- /*   200 */   188,  185,  186,  189,   27,    5,  231,   10,   10,   18,
- /*   210 */    18,  177,    6,  173,  173,   10,   10,   18,   18,   27,
- /*   220 */   204,  172,  172,    7,  251,  252,   27,  199,  249,   27,
- /*   230 */    10,   10,   18,   18,   27,  215,  178,  178,  165,   19,
- /*   240 */    19,  165,   23,   23,  180,   11,   11,   20,   20,   27,
- /*   250 */   205,  250,  181,  182,  183,  225,  226,  272,  272,  272,
- /*   260 */    12,   12,   21,   21,  272,  200,  272,  272,  272,  272,
- /*   270 */   272,  272,  272,  272,  272,  272,  272,  198,
+ /*     0 */   408,    1,  139,   32,  149,  150,  151,  152,  153,  154,
+ /*    10 */    43,  156,   31,   29,   40,   38,   30,   14,  163,  164,
+ /*    20 */   165,   42,  218,   13,   13,   29,  241,  227,  228,  270,
+ /*    30 */    34,   34,   27,  266,   26,   25,   42,   40,   38,  221,
+ /*    40 */     8,  224,   41,  193,   15,   15,  272,  146,  270,  182,
+ /*    50 */    16,  270,  266,  227,  228,  266,  255,  140,  141,  142,
+ /*    60 */   143,  144,  145,  232,    7,    6,   17,    4,    3,    2,
+ /*    70 */    18,   28,  219,  147,    5,  241,  243,  246,  249,  244,
+ /*    80 */   247,  250,  261,  146,  224,  167,   16,  270,  189,  227,
+ /*    90 */   228,  266,  255,  140,  141,  142,  143,  144,  145,  232,
+ /*   100 */     7,    6,   17,    4,    3,    2,   18,  241,  263,  147,
+ /*   110 */     5,  241,  243,  246,  249,  244,  247,  250,  261,  138,
+ /*   120 */    32,  149,  150,  151,  152,  153,  154,   43,  156,   31,
+ /*   130 */    29,   40,   38,   30,   14,  163,  164,  165,  262,  253,
+ /*   140 */   254,  186,   29,  251,   37,   37,  256,   34,   34,   27,
+ /*   150 */   257,   26,   25,   23,   40,   38,  216,    8,  199,   41,
+ /*   160 */   217,   15,   15,  211,  213,  214,  252,  194,  196,  192,
+ /*   170 */   195,  197,  253,  254,   28,  198,  251,    9,   42,    9,
+ /*   180 */    13,   13,   33,   33,  172,   10,   10,   19,   19,  166,
+ /*   190 */     5,  175,  175,   35,   35,    5,   28,   36,   36,  252,
+ /*   200 */   190,  187,  188,  191,   28,   39,   39,   10,   10,   19,
+ /*   210 */    19,  179,  234,  174,  174,   10,   10,   19,   19,   28,
+ /*   220 */   206,  173,  173,  233,  253,  254,   28,    6,  251,   28,
+ /*   230 */    10,   10,   19,   19,   28,    7,  180,  180,  166,   20,
+ /*   240 */    20,  166,   24,   24,  201,   11,   11,   21,   21,   28,
+ /*   250 */   207,  252,  183,  184,  185,  227,  228,  182,  217,  274,
+ /*   260 */    12,   12,   22,   22,  274,  202,  274,  274,  274,  274,
+ /*   270 */   274,  274,  274,  274,  274,  274,  274,  200,
 };
 static const YYCODETYPE yy_lookahead[] = {
  /*     0 */    38,   39,   40,   41,   42,   43,   44,   45,   46,   47,
@@ -239,43 +239,44 @@ static const YYCODETYPE yy_lookahead[] = {
  /*   160 */     9,   82,   83,   77,    2,    3,   29,   30,   31,   32,
  /*   170 */    33,   34,    2,    3,   48,   74,    6,   79,   80,   81,
  /*   180 */    82,   83,   59,   60,   67,   59,   60,   61,   62,   60,
- /*   190 */    28,   65,   66,   59,   60,    6,   48,   59,   60,   29,
- /*   200 */    30,   31,   32,   33,   48,   28,   17,   59,   60,   61,
- /*   210 */    62,   69,   19,   65,   66,   59,   60,   61,   62,   48,
- /*   220 */    76,   65,   66,   18,    2,    3,   48,   75,    6,   48,
- /*   230 */    59,   60,   61,   62,   48,    9,   65,   66,   60,   61,
- /*   240 */    62,   60,   61,   62,   29,   59,   60,   61,   62,   48,
- /*   250 */    64,   29,   30,   31,   32,    7,    8,   84,   84,   84,
+ /*   190 */    28,   65,   66,   59,   60,   28,   48,   59,   60,   29,
+ /*   200 */    30,   31,   32,   33,   48,   59,   60,   59,   60,   61,
+ /*   210 */    62,   69,    6,   65,   66,   59,   60,   61,   62,   48,
+ /*   220 */    76,   65,   66,   17,    2,    3,   48,   19,    6,   48,
+ /*   230 */    59,   60,   61,   62,   48,   18,   65,   66,   60,   61,
+ /*   240 */    62,   60,   61,   62,   75,   59,   60,   61,   62,   48,
+ /*   250 */    64,   29,   30,   31,   32,    7,    8,   29,    9,   84,
  /*   260 */    59,   60,   61,   62,   84,   64,   84,   84,   84,   84,
  /*   270 */    84,   84,   84,   84,   84,   84,   84,   29,
 };
 #define YY_SHIFT_USE_DFLT (278)
-#define YY_SHIFT_COUNT    (41)
+#define YY_SHIFT_COUNT    (43)
 #define YY_SHIFT_MIN      (-3)
-#define YY_SHIFT_MAX      (248)
+#define YY_SHIFT_MAX      (249)
 static const short yy_shift_ofst[] = {
  /*     0 */    82,   46,   78,   78,   78,   78,   78,   78,   24,   24,
- /*    10 */    78,   78,   78,   43,  162,   24,   35,   35,   -3,   -3,
- /*    20 */    -3,   -3,   35,   -3,  137,  170,  222,   20,  248,  102,
- /*    30 */   140,  189,   35,  177,   35,  177,  193,   35,  205,  151,
- /*    40 */   226,  215,
+ /*    10 */    78,   78,   78,   43,  162,   24,   35,   35,   35,   -3,
+ /*    20 */    -3,   -3,   -3,   35,   -3,  137,  170,  222,   20,  248,
+ /*    30 */   102,  140,  206,   35,  167,   35,   35,  167,  208,   35,
+ /*    40 */   217,  151,  249,  228,
 };
 #define YY_REDUCE_USE_DFLT (-60)
-#define YY_REDUCE_COUNT (38)
+#define YY_REDUCE_COUNT (40)
 #define YY_REDUCE_MIN   (-59)
 #define YY_REDUCE_MAX   (201)
 static const short yy_reduce_ofst[] = {
  /*     0 */   -38,   79,  126,  148,  156,  171,  186,  201,   98,  -59,
- /*    10 */   178,  181,  181,  -44,   76,  -44,  123,  134,   23,   23,
- /*    20 */    23,   23,  138,   23,  -28,   17,   70,   90,   95,   86,
- /*    30 */   101,  117,  129,  142,  129,  142,  144,  129,  152,
+ /*    10 */   178,  181,  181,  -44,   76,  -44,  123,  134,  138,   23,
+ /*    20 */    23,   23,   23,  146,   23,  -28,   17,   70,   90,   95,
+ /*    30 */    86,  101,  117,  129,  142,  129,  129,  142,  144,  129,
+ /*    40 */   169,
 };
 static const YYACTIONTYPE yy_default[] = {
- /*     0 */   404,  404,  369,  368,  367,  313,  342,  337,  397,  347,
- /*    10 */   361,  340,  335,  352,  295,  354,  396,  370,  363,  304,
- /*    20 */   341,  336,  302,  303,  380,  377,  374,  358,  291,  294,
- /*    30 */   290,  281,  344,  403,  309,  310,  293,  301,  292,  401,
- /*    40 */   401,  288,
+ /*     0 */   407,  407,  372,  371,  370,  316,  345,  340,  400,  350,
+ /*    10 */   364,  343,  338,  355,  297,  357,  399,  374,  373,  366,
+ /*    20 */   306,  344,  339,  304,  305,  383,  380,  377,  361,  293,
+ /*    30 */   296,  292,  283,  347,  406,  312,  311,  313,  295,  303,
+ /*    40 */   294,  404,  404,  290,
 };
 /********** End of lemon-generated parsing tables *****************************/
 
@@ -475,100 +476,101 @@ static const char *const yyRuleName[] = {
  /*  37 */ "def_footnote ::= LINE_DEF_FOOTNOTE tail",
  /*  38 */ "def_glossary ::= LINE_DEF_GLOSSARY tail",
  /*  39 */ "def_link ::= LINE_DEF_LINK chunk",
- /*  40 */ "definition_block ::= para defs",
- /*  41 */ "defs ::= defs def",
- /*  42 */ "def ::= LINE_DEFINITION tail",
- /*  43 */ "def ::= LINE_DEFINITION",
- /*  44 */ "empty ::= empty LINE_EMPTY",
- /*  45 */ "fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_3",
- /*  46 */ "fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_4",
- /*  47 */ "fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_5",
- /*  48 */ "fenced_3 ::= fenced_3 fenced_line",
- /*  49 */ "fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_4",
- /*  50 */ "fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_5",
- /*  51 */ "fenced_4 ::= fenced_4 fenced_line",
- /*  52 */ "fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_3",
- /*  53 */ "fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_START_3",
- /*  54 */ "fenced_block ::= fenced_5 LINE_FENCE_BACKTICK_5",
- /*  55 */ "fenced_5 ::= fenced_5 fenced_line",
- /*  56 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_3",
- /*  57 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_3",
- /*  58 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_4",
- /*  59 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_4",
- /*  60 */ "html_block ::= html_block html_line",
- /*  61 */ "indented_code ::= indented_code indented_line",
- /*  62 */ "indented_code ::= indented_code LINE_EMPTY",
- /*  63 */ "list_bullet ::= list_bullet item_bullet",
- /*  64 */ "item_bullet ::= LINE_LIST_BULLETED ext_chunk",
- /*  65 */ "item_bullet ::= LINE_LIST_BULLETED chunk",
- /*  66 */ "item_bullet ::= LINE_LIST_BULLETED nested_chunks",
- /*  67 */ "item_bullet ::= LINE_LIST_BULLETED",
- /*  68 */ "list_enum ::= list_enum item_enum",
- /*  69 */ "item_enum ::= LINE_LIST_ENUMERATED ext_chunk",
- /*  70 */ "item_enum ::= LINE_LIST_ENUMERATED chunk",
- /*  71 */ "item_enum ::= LINE_LIST_ENUMERATED nested_chunks",
- /*  72 */ "item_enum ::= LINE_LIST_ENUMERATED",
- /*  73 */ "meta_block ::= meta_block meta_line",
- /*  74 */ "para ::= LINE_PLAIN chunk",
- /*  75 */ "setext_1 ::= para LINE_SETEXT_1",
- /*  76 */ "setext_2 ::= para LINE_SETEXT_2",
- /*  77 */ "table ::= table_header table_body",
- /*  78 */ "table_header ::= header_rows LINE_TABLE_SEPARATOR",
- /*  79 */ "header_rows ::= header_rows LINE_TABLE",
- /*  80 */ "table_body ::= table_body table_section",
- /*  81 */ "table_section ::= all_rows LINE_EMPTY",
- /*  82 */ "table_section ::= all_rows",
- /*  83 */ "all_rows ::= all_rows row",
- /*  84 */ "para ::= all_rows",
- /*  85 */ "chunk ::= chunk_line",
- /*  86 */ "chunk_line ::= LINE_CONTINUATION",
- /*  87 */ "nested_chunks ::= nested_chunk",
- /*  88 */ "nested_chunk ::= empty",
- /*  89 */ "indented_line ::= LINE_INDENTED_TAB",
- /*  90 */ "indented_line ::= LINE_INDENTED_SPACE",
- /*  91 */ "opt_ext_chunk ::= chunk",
- /*  92 */ "tail ::= opt_ext_chunk",
- /*  93 */ "tail ::= nested_chunks",
- /*  94 */ "blockquote ::= LINE_BLOCKQUOTE",
- /*  95 */ "quote_line ::= LINE_BLOCKQUOTE",
- /*  96 */ "quote_line ::= LINE_CONTINUATION",
- /*  97 */ "def_citation ::= LINE_DEF_CITATION",
- /*  98 */ "def_footnote ::= LINE_DEF_FOOTNOTE",
- /*  99 */ "def_glossary ::= LINE_DEF_GLOSSARY",
- /* 100 */ "def_link ::= LINE_DEF_LINK",
- /* 101 */ "def_abbreviation ::= LINE_DEF_ABBREVIATION",
- /* 102 */ "defs ::= def",
- /* 103 */ "empty ::= LINE_EMPTY",
- /* 104 */ "fenced_block ::= fenced_3",
- /* 105 */ "fenced_3 ::= LINE_FENCE_BACKTICK_3",
- /* 106 */ "fenced_3 ::= LINE_FENCE_BACKTICK_START_3",
- /* 107 */ "fenced_block ::= fenced_4",
- /* 108 */ "fenced_4 ::= LINE_FENCE_BACKTICK_4",
- /* 109 */ "fenced_4 ::= LINE_FENCE_BACKTICK_START_4",
- /* 110 */ "fenced_block ::= fenced_5",
- /* 111 */ "fenced_5 ::= LINE_FENCE_BACKTICK_5",
- /* 112 */ "fenced_5 ::= LINE_FENCE_BACKTICK_START_5",
- /* 113 */ "fenced_line ::= LINE_CONTINUATION",
- /* 114 */ "fenced_line ::= LINE_EMPTY",
- /* 115 */ "fenced_line ::= LINE_SETEXT_1",
- /* 116 */ "fenced_line ::= LINE_SETEXT_2",
- /* 117 */ "html_block ::= LINE_HTML",
- /* 118 */ "html_line ::= LINE_CONTINUATION",
- /* 119 */ "html_line ::= LINE_HTML",
- /* 120 */ "indented_code ::= indented_line",
- /* 121 */ "list_bullet ::= item_bullet",
- /* 122 */ "list_enum ::= item_enum",
- /* 123 */ "meta_block ::= LINE_META",
- /* 124 */ "meta_line ::= LINE_META",
- /* 125 */ "meta_line ::= LINE_CONTINUATION",
- /* 126 */ "para ::= LINE_PLAIN",
- /* 127 */ "table ::= table_header",
- /* 128 */ "header_rows ::= LINE_TABLE",
- /* 129 */ "table_body ::= table_section",
- /* 130 */ "all_rows ::= row",
- /* 131 */ "row ::= header_rows",
- /* 132 */ "row ::= LINE_TABLE_SEPARATOR",
- /* 133 */ "para ::= defs",
+ /*  40 */ "def_abbreviation ::= LINE_DEF_ABBREVIATION chunk",
+ /*  41 */ "definition_block ::= para defs",
+ /*  42 */ "defs ::= defs def",
+ /*  43 */ "def ::= LINE_DEFINITION tail",
+ /*  44 */ "def ::= LINE_DEFINITION",
+ /*  45 */ "empty ::= empty LINE_EMPTY",
+ /*  46 */ "fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_3",
+ /*  47 */ "fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_4",
+ /*  48 */ "fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_5",
+ /*  49 */ "fenced_3 ::= fenced_3 fenced_line",
+ /*  50 */ "fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_4",
+ /*  51 */ "fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_5",
+ /*  52 */ "fenced_4 ::= fenced_4 fenced_line",
+ /*  53 */ "fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_3",
+ /*  54 */ "fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_START_3",
+ /*  55 */ "fenced_block ::= fenced_5 LINE_FENCE_BACKTICK_5",
+ /*  56 */ "fenced_5 ::= fenced_5 fenced_line",
+ /*  57 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_3",
+ /*  58 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_3",
+ /*  59 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_4",
+ /*  60 */ "fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_4",
+ /*  61 */ "html_block ::= html_block html_line",
+ /*  62 */ "indented_code ::= indented_code indented_line",
+ /*  63 */ "indented_code ::= indented_code LINE_EMPTY",
+ /*  64 */ "list_bullet ::= list_bullet item_bullet",
+ /*  65 */ "item_bullet ::= LINE_LIST_BULLETED ext_chunk",
+ /*  66 */ "item_bullet ::= LINE_LIST_BULLETED chunk",
+ /*  67 */ "item_bullet ::= LINE_LIST_BULLETED nested_chunks",
+ /*  68 */ "item_bullet ::= LINE_LIST_BULLETED",
+ /*  69 */ "list_enum ::= list_enum item_enum",
+ /*  70 */ "item_enum ::= LINE_LIST_ENUMERATED ext_chunk",
+ /*  71 */ "item_enum ::= LINE_LIST_ENUMERATED chunk",
+ /*  72 */ "item_enum ::= LINE_LIST_ENUMERATED nested_chunks",
+ /*  73 */ "item_enum ::= LINE_LIST_ENUMERATED",
+ /*  74 */ "meta_block ::= meta_block meta_line",
+ /*  75 */ "para ::= LINE_PLAIN chunk",
+ /*  76 */ "setext_1 ::= para LINE_SETEXT_1",
+ /*  77 */ "setext_2 ::= para LINE_SETEXT_2",
+ /*  78 */ "table ::= table_header table_body",
+ /*  79 */ "table_header ::= header_rows LINE_TABLE_SEPARATOR",
+ /*  80 */ "header_rows ::= header_rows LINE_TABLE",
+ /*  81 */ "table_body ::= table_body table_section",
+ /*  82 */ "table_section ::= all_rows LINE_EMPTY",
+ /*  83 */ "table_section ::= all_rows",
+ /*  84 */ "all_rows ::= all_rows row",
+ /*  85 */ "para ::= all_rows",
+ /*  86 */ "chunk ::= chunk_line",
+ /*  87 */ "chunk_line ::= LINE_CONTINUATION",
+ /*  88 */ "nested_chunks ::= nested_chunk",
+ /*  89 */ "nested_chunk ::= empty",
+ /*  90 */ "indented_line ::= LINE_INDENTED_TAB",
+ /*  91 */ "indented_line ::= LINE_INDENTED_SPACE",
+ /*  92 */ "opt_ext_chunk ::= chunk",
+ /*  93 */ "tail ::= opt_ext_chunk",
+ /*  94 */ "tail ::= nested_chunks",
+ /*  95 */ "blockquote ::= LINE_BLOCKQUOTE",
+ /*  96 */ "quote_line ::= LINE_BLOCKQUOTE",
+ /*  97 */ "quote_line ::= LINE_CONTINUATION",
+ /*  98 */ "def_citation ::= LINE_DEF_CITATION",
+ /*  99 */ "def_footnote ::= LINE_DEF_FOOTNOTE",
+ /* 100 */ "def_glossary ::= LINE_DEF_GLOSSARY",
+ /* 101 */ "def_link ::= LINE_DEF_LINK",
+ /* 102 */ "def_abbreviation ::= LINE_DEF_ABBREVIATION",
+ /* 103 */ "defs ::= def",
+ /* 104 */ "empty ::= LINE_EMPTY",
+ /* 105 */ "fenced_block ::= fenced_3",
+ /* 106 */ "fenced_3 ::= LINE_FENCE_BACKTICK_3",
+ /* 107 */ "fenced_3 ::= LINE_FENCE_BACKTICK_START_3",
+ /* 108 */ "fenced_block ::= fenced_4",
+ /* 109 */ "fenced_4 ::= LINE_FENCE_BACKTICK_4",
+ /* 110 */ "fenced_4 ::= LINE_FENCE_BACKTICK_START_4",
+ /* 111 */ "fenced_block ::= fenced_5",
+ /* 112 */ "fenced_5 ::= LINE_FENCE_BACKTICK_5",
+ /* 113 */ "fenced_5 ::= LINE_FENCE_BACKTICK_START_5",
+ /* 114 */ "fenced_line ::= LINE_CONTINUATION",
+ /* 115 */ "fenced_line ::= LINE_EMPTY",
+ /* 116 */ "fenced_line ::= LINE_SETEXT_1",
+ /* 117 */ "fenced_line ::= LINE_SETEXT_2",
+ /* 118 */ "html_block ::= LINE_HTML",
+ /* 119 */ "html_line ::= LINE_CONTINUATION",
+ /* 120 */ "html_line ::= LINE_HTML",
+ /* 121 */ "indented_code ::= indented_line",
+ /* 122 */ "list_bullet ::= item_bullet",
+ /* 123 */ "list_enum ::= item_enum",
+ /* 124 */ "meta_block ::= LINE_META",
+ /* 125 */ "meta_line ::= LINE_META",
+ /* 126 */ "meta_line ::= LINE_CONTINUATION",
+ /* 127 */ "para ::= LINE_PLAIN",
+ /* 128 */ "table ::= table_header",
+ /* 129 */ "header_rows ::= LINE_TABLE",
+ /* 130 */ "table_body ::= table_section",
+ /* 131 */ "all_rows ::= row",
+ /* 132 */ "row ::= header_rows",
+ /* 133 */ "row ::= LINE_TABLE_SEPARATOR",
+ /* 134 */ "para ::= defs",
 };
 #endif /* NDEBUG */
 
@@ -957,6 +959,7 @@ static const struct {
   { 44, 2 },
   { 45, 2 },
   { 46, 2 },
+  { 42, 2 },
   { 47, 2 },
   { 68, 2 },
   { 69, 2 },
@@ -1253,30 +1256,31 @@ static void yy_reduce(
       case 37: /* def_footnote ::= LINE_DEF_FOOTNOTE tail */ yytestcase(yyruleno==37);
       case 38: /* def_glossary ::= LINE_DEF_GLOSSARY tail */ yytestcase(yyruleno==38);
       case 39: /* def_link ::= LINE_DEF_LINK chunk */ yytestcase(yyruleno==39);
-      case 41: /* defs ::= defs def */ yytestcase(yyruleno==41);
-      case 44: /* empty ::= empty LINE_EMPTY */ yytestcase(yyruleno==44);
-      case 48: /* fenced_3 ::= fenced_3 fenced_line */ yytestcase(yyruleno==48);
-      case 51: /* fenced_4 ::= fenced_4 fenced_line */ yytestcase(yyruleno==51);
-      case 52: /* fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_3 */ yytestcase(yyruleno==52);
-      case 53: /* fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_START_3 */ yytestcase(yyruleno==53);
-      case 55: /* fenced_5 ::= fenced_5 fenced_line */ yytestcase(yyruleno==55);
-      case 56: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_3 */ yytestcase(yyruleno==56);
-      case 57: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_3 */ yytestcase(yyruleno==57);
-      case 58: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==58);
-      case 59: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_4 */ yytestcase(yyruleno==59);
-      case 60: /* html_block ::= html_block html_line */ yytestcase(yyruleno==60);
-      case 61: /* indented_code ::= indented_code indented_line */ yytestcase(yyruleno==61);
-      case 62: /* indented_code ::= indented_code LINE_EMPTY */ yytestcase(yyruleno==62);
-      case 63: /* list_bullet ::= list_bullet item_bullet */ yytestcase(yyruleno==63);
-      case 68: /* list_enum ::= list_enum item_enum */ yytestcase(yyruleno==68);
-      case 73: /* meta_block ::= meta_block meta_line */ yytestcase(yyruleno==73);
-      case 74: /* para ::= LINE_PLAIN chunk */ yytestcase(yyruleno==74);
-      case 75: /* setext_1 ::= para LINE_SETEXT_1 */ yytestcase(yyruleno==75);
-      case 76: /* setext_2 ::= para LINE_SETEXT_2 */ yytestcase(yyruleno==76);
-      case 77: /* table ::= table_header table_body */ yytestcase(yyruleno==77);
-      case 79: /* header_rows ::= header_rows LINE_TABLE */ yytestcase(yyruleno==79);
-      case 80: /* table_body ::= table_body table_section */ yytestcase(yyruleno==80);
-      case 83: /* all_rows ::= all_rows row */ yytestcase(yyruleno==83);
+      case 40: /* def_abbreviation ::= LINE_DEF_ABBREVIATION chunk */ yytestcase(yyruleno==40);
+      case 42: /* defs ::= defs def */ yytestcase(yyruleno==42);
+      case 45: /* empty ::= empty LINE_EMPTY */ yytestcase(yyruleno==45);
+      case 49: /* fenced_3 ::= fenced_3 fenced_line */ yytestcase(yyruleno==49);
+      case 52: /* fenced_4 ::= fenced_4 fenced_line */ yytestcase(yyruleno==52);
+      case 53: /* fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_3 */ yytestcase(yyruleno==53);
+      case 54: /* fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_START_3 */ yytestcase(yyruleno==54);
+      case 56: /* fenced_5 ::= fenced_5 fenced_line */ yytestcase(yyruleno==56);
+      case 57: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_3 */ yytestcase(yyruleno==57);
+      case 58: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_3 */ yytestcase(yyruleno==58);
+      case 59: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==59);
+      case 60: /* fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_4 */ yytestcase(yyruleno==60);
+      case 61: /* html_block ::= html_block html_line */ yytestcase(yyruleno==61);
+      case 62: /* indented_code ::= indented_code indented_line */ yytestcase(yyruleno==62);
+      case 63: /* indented_code ::= indented_code LINE_EMPTY */ yytestcase(yyruleno==63);
+      case 64: /* list_bullet ::= list_bullet item_bullet */ yytestcase(yyruleno==64);
+      case 69: /* list_enum ::= list_enum item_enum */ yytestcase(yyruleno==69);
+      case 74: /* meta_block ::= meta_block meta_line */ yytestcase(yyruleno==74);
+      case 75: /* para ::= LINE_PLAIN chunk */ yytestcase(yyruleno==75);
+      case 76: /* setext_1 ::= para LINE_SETEXT_1 */ yytestcase(yyruleno==76);
+      case 77: /* setext_2 ::= para LINE_SETEXT_2 */ yytestcase(yyruleno==77);
+      case 78: /* table ::= table_header table_body */ yytestcase(yyruleno==78);
+      case 80: /* header_rows ::= header_rows LINE_TABLE */ yytestcase(yyruleno==80);
+      case 81: /* table_body ::= table_body table_section */ yytestcase(yyruleno==81);
+      case 84: /* all_rows ::= all_rows row */ yytestcase(yyruleno==84);
 { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
@@ -1288,110 +1292,110 @@ static void yy_reduce(
 { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yymsp[0].minor.yy0->type = LINE_CONTINUATION; }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 40: /* definition_block ::= para defs */
+      case 41: /* definition_block ::= para defs */
 { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yymsp[-1].minor.yy0->type = BLOCK_TERM; }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 42: /* def ::= LINE_DEFINITION tail */
+      case 43: /* def ::= LINE_DEFINITION tail */
 { yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_DEFINITION); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); recursive_parse_indent(engine, yylhsminor.yy0); }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 43: /* def ::= LINE_DEFINITION */
+      case 44: /* def ::= LINE_DEFINITION */
 { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_DEFINITION);  }
   yymsp[0].minor.yy0 = yylhsminor.yy0;
         break;
-      case 45: /* fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_3 */
-      case 46: /* fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==46);
-      case 47: /* fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==47);
-      case 49: /* fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==49);
-      case 50: /* fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==50);
-      case 54: /* fenced_block ::= fenced_5 LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==54);
+      case 46: /* fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_3 */
+      case 47: /* fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==47);
+      case 48: /* fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==48);
+      case 50: /* fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==50);
+      case 51: /* fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==51);
+      case 55: /* fenced_block ::= fenced_5 LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==55);
 { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yymsp[0].minor.yy0->child->type = CODE_FENCE; }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 64: /* item_bullet ::= LINE_LIST_BULLETED ext_chunk */
-      case 66: /* item_bullet ::= LINE_LIST_BULLETED nested_chunks */ yytestcase(yyruleno==66);
-      case 69: /* item_enum ::= LINE_LIST_ENUMERATED ext_chunk */ yytestcase(yyruleno==69);
-      case 71: /* item_enum ::= LINE_LIST_ENUMERATED nested_chunks */ yytestcase(yyruleno==71);
+      case 65: /* item_bullet ::= LINE_LIST_BULLETED ext_chunk */
+      case 67: /* item_bullet ::= LINE_LIST_BULLETED nested_chunks */ yytestcase(yyruleno==67);
+      case 70: /* item_enum ::= LINE_LIST_ENUMERATED ext_chunk */ yytestcase(yyruleno==70);
+      case 72: /* item_enum ::= LINE_LIST_ENUMERATED nested_chunks */ yytestcase(yyruleno==72);
 { yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_LIST_ITEM); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); recursive_parse_list_item(engine, yylhsminor.yy0); }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 65: /* item_bullet ::= LINE_LIST_BULLETED chunk */
-      case 70: /* item_enum ::= LINE_LIST_ENUMERATED chunk */ yytestcase(yyruleno==70);
+      case 66: /* item_bullet ::= LINE_LIST_BULLETED chunk */
+      case 71: /* item_enum ::= LINE_LIST_ENUMERATED chunk */ yytestcase(yyruleno==71);
 { yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_LIST_ITEM_TIGHT); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); recursive_parse_list_item(engine, yylhsminor.yy0); }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 67: /* item_bullet ::= LINE_LIST_BULLETED */
-      case 72: /* item_enum ::= LINE_LIST_ENUMERATED */ yytestcase(yyruleno==72);
+      case 68: /* item_bullet ::= LINE_LIST_BULLETED */
+      case 73: /* item_enum ::= LINE_LIST_ENUMERATED */ yytestcase(yyruleno==73);
 { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_LIST_ITEM_TIGHT); }
   yymsp[0].minor.yy0 = yylhsminor.yy0;
         break;
-      case 78: /* table_header ::= header_rows LINE_TABLE_SEPARATOR */
+      case 79: /* table_header ::= header_rows LINE_TABLE_SEPARATOR */
 { yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_TABLE_HEADER); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 81: /* table_section ::= all_rows LINE_EMPTY */
+      case 82: /* table_section ::= all_rows LINE_EMPTY */
 { yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_TABLE_SECTION); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
-      case 82: /* table_section ::= all_rows */
+      case 83: /* table_section ::= all_rows */
 { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_TABLE_SECTION); }
   yymsp[0].minor.yy0 = yylhsminor.yy0;
         break;
-      case 84: /* para ::= all_rows */
+      case 85: /* para ::= all_rows */
 { yylhsminor.yy0 = yymsp[0].minor.yy0; }
   yymsp[0].minor.yy0 = yylhsminor.yy0;
         break;
       default:
-      /* (85) chunk ::= chunk_line (OPTIMIZED OUT) */ assert(yyruleno!=85);
-      /* (86) chunk_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==86);
-      /* (87) nested_chunks ::= nested_chunk (OPTIMIZED OUT) */ assert(yyruleno!=87);
-      /* (88) nested_chunk ::= empty */ yytestcase(yyruleno==88);
-      /* (89) indented_line ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==89);
-      /* (90) indented_line ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==90);
-      /* (91) opt_ext_chunk ::= chunk */ yytestcase(yyruleno==91);
-      /* (92) tail ::= opt_ext_chunk (OPTIMIZED OUT) */ assert(yyruleno!=92);
-      /* (93) tail ::= nested_chunks */ yytestcase(yyruleno==93);
-      /* (94) blockquote ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==94);
-      /* (95) quote_line ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==95);
-      /* (96) quote_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==96);
-      /* (97) def_citation ::= LINE_DEF_CITATION */ yytestcase(yyruleno==97);
-      /* (98) def_footnote ::= LINE_DEF_FOOTNOTE */ yytestcase(yyruleno==98);
-      /* (99) def_glossary ::= LINE_DEF_GLOSSARY */ yytestcase(yyruleno==99);
-      /* (100) def_link ::= LINE_DEF_LINK */ yytestcase(yyruleno==100);
-      /* (101) def_abbreviation ::= LINE_DEF_ABBREVIATION */ yytestcase(yyruleno==101);
-      /* (102) defs ::= def (OPTIMIZED OUT) */ assert(yyruleno!=102);
-      /* (103) empty ::= LINE_EMPTY */ yytestcase(yyruleno==103);
-      /* (104) fenced_block ::= fenced_3 */ yytestcase(yyruleno==104);
-      /* (105) fenced_3 ::= LINE_FENCE_BACKTICK_3 */ yytestcase(yyruleno==105);
-      /* (106) fenced_3 ::= LINE_FENCE_BACKTICK_START_3 */ yytestcase(yyruleno==106);
-      /* (107) fenced_block ::= fenced_4 */ yytestcase(yyruleno==107);
-      /* (108) fenced_4 ::= LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==108);
-      /* (109) fenced_4 ::= LINE_FENCE_BACKTICK_START_4 */ yytestcase(yyruleno==109);
-      /* (110) fenced_block ::= fenced_5 */ yytestcase(yyruleno==110);
-      /* (111) fenced_5 ::= LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==111);
-      /* (112) fenced_5 ::= LINE_FENCE_BACKTICK_START_5 */ yytestcase(yyruleno==112);
-      /* (113) fenced_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==113);
-      /* (114) fenced_line ::= LINE_EMPTY */ yytestcase(yyruleno==114);
-      /* (115) fenced_line ::= LINE_SETEXT_1 */ yytestcase(yyruleno==115);
-      /* (116) fenced_line ::= LINE_SETEXT_2 */ yytestcase(yyruleno==116);
-      /* (117) html_block ::= LINE_HTML */ yytestcase(yyruleno==117);
-      /* (118) html_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==118);
-      /* (119) html_line ::= LINE_HTML */ yytestcase(yyruleno==119);
-      /* (120) indented_code ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=120);
-      /* (121) list_bullet ::= item_bullet (OPTIMIZED OUT) */ assert(yyruleno!=121);
-      /* (122) list_enum ::= item_enum (OPTIMIZED OUT) */ assert(yyruleno!=122);
-      /* (123) meta_block ::= LINE_META */ yytestcase(yyruleno==123);
-      /* (124) meta_line ::= LINE_META */ yytestcase(yyruleno==124);
-      /* (125) meta_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==125);
-      /* (126) para ::= LINE_PLAIN */ yytestcase(yyruleno==126);
-      /* (127) table ::= table_header */ yytestcase(yyruleno==127);
-      /* (128) header_rows ::= LINE_TABLE */ yytestcase(yyruleno==128);
-      /* (129) table_body ::= table_section (OPTIMIZED OUT) */ assert(yyruleno!=129);
-      /* (130) all_rows ::= row (OPTIMIZED OUT) */ assert(yyruleno!=130);
-      /* (131) row ::= header_rows */ yytestcase(yyruleno==131);
-      /* (132) row ::= LINE_TABLE_SEPARATOR */ yytestcase(yyruleno==132);
-      /* (133) para ::= defs */ yytestcase(yyruleno==133);
+      /* (86) chunk ::= chunk_line (OPTIMIZED OUT) */ assert(yyruleno!=86);
+      /* (87) chunk_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==87);
+      /* (88) nested_chunks ::= nested_chunk (OPTIMIZED OUT) */ assert(yyruleno!=88);
+      /* (89) nested_chunk ::= empty */ yytestcase(yyruleno==89);
+      /* (90) indented_line ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==90);
+      /* (91) indented_line ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==91);
+      /* (92) opt_ext_chunk ::= chunk */ yytestcase(yyruleno==92);
+      /* (93) tail ::= opt_ext_chunk (OPTIMIZED OUT) */ assert(yyruleno!=93);
+      /* (94) tail ::= nested_chunks */ yytestcase(yyruleno==94);
+      /* (95) blockquote ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==95);
+      /* (96) quote_line ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==96);
+      /* (97) quote_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==97);
+      /* (98) def_citation ::= LINE_DEF_CITATION */ yytestcase(yyruleno==98);
+      /* (99) def_footnote ::= LINE_DEF_FOOTNOTE */ yytestcase(yyruleno==99);
+      /* (100) def_glossary ::= LINE_DEF_GLOSSARY */ yytestcase(yyruleno==100);
+      /* (101) def_link ::= LINE_DEF_LINK */ yytestcase(yyruleno==101);
+      /* (102) def_abbreviation ::= LINE_DEF_ABBREVIATION */ yytestcase(yyruleno==102);
+      /* (103) defs ::= def (OPTIMIZED OUT) */ assert(yyruleno!=103);
+      /* (104) empty ::= LINE_EMPTY */ yytestcase(yyruleno==104);
+      /* (105) fenced_block ::= fenced_3 */ yytestcase(yyruleno==105);
+      /* (106) fenced_3 ::= LINE_FENCE_BACKTICK_3 */ yytestcase(yyruleno==106);
+      /* (107) fenced_3 ::= LINE_FENCE_BACKTICK_START_3 */ yytestcase(yyruleno==107);
+      /* (108) fenced_block ::= fenced_4 */ yytestcase(yyruleno==108);
+      /* (109) fenced_4 ::= LINE_FENCE_BACKTICK_4 */ yytestcase(yyruleno==109);
+      /* (110) fenced_4 ::= LINE_FENCE_BACKTICK_START_4 */ yytestcase(yyruleno==110);
+      /* (111) fenced_block ::= fenced_5 */ yytestcase(yyruleno==111);
+      /* (112) fenced_5 ::= LINE_FENCE_BACKTICK_5 */ yytestcase(yyruleno==112);
+      /* (113) fenced_5 ::= LINE_FENCE_BACKTICK_START_5 */ yytestcase(yyruleno==113);
+      /* (114) fenced_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==114);
+      /* (115) fenced_line ::= LINE_EMPTY */ yytestcase(yyruleno==115);
+      /* (116) fenced_line ::= LINE_SETEXT_1 */ yytestcase(yyruleno==116);
+      /* (117) fenced_line ::= LINE_SETEXT_2 */ yytestcase(yyruleno==117);
+      /* (118) html_block ::= LINE_HTML */ yytestcase(yyruleno==118);
+      /* (119) html_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==119);
+      /* (120) html_line ::= LINE_HTML */ yytestcase(yyruleno==120);
+      /* (121) indented_code ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=121);
+      /* (122) list_bullet ::= item_bullet (OPTIMIZED OUT) */ assert(yyruleno!=122);
+      /* (123) list_enum ::= item_enum (OPTIMIZED OUT) */ assert(yyruleno!=123);
+      /* (124) meta_block ::= LINE_META */ yytestcase(yyruleno==124);
+      /* (125) meta_line ::= LINE_META */ yytestcase(yyruleno==125);
+      /* (126) meta_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==126);
+      /* (127) para ::= LINE_PLAIN */ yytestcase(yyruleno==127);
+      /* (128) table ::= table_header */ yytestcase(yyruleno==128);
+      /* (129) header_rows ::= LINE_TABLE */ yytestcase(yyruleno==129);
+      /* (130) table_body ::= table_section (OPTIMIZED OUT) */ assert(yyruleno!=130);
+      /* (131) all_rows ::= row (OPTIMIZED OUT) */ assert(yyruleno!=131);
+      /* (132) row ::= header_rows */ yytestcase(yyruleno==132);
+      /* (133) row ::= LINE_TABLE_SEPARATOR */ yytestcase(yyruleno==133);
+      /* (134) para ::= defs */ yytestcase(yyruleno==134);
         break;
 /********** End reduce actions ************************************************/
   };
index f62e8b200f0cf60346fd0f3c6990ef213a10766c..9109789176ceed739d6267934faf0817ff5d503c 100644 (file)
@@ -40,6 +40,7 @@ State 0:
           def_glossary ::= * LINE_DEF_GLOSSARY
           def_link ::= * LINE_DEF_LINK chunk
           def_link ::= * LINE_DEF_LINK
+          def_abbreviation ::= * LINE_DEF_ABBREVIATION chunk
           def_abbreviation ::= * LINE_DEF_ABBREVIATION
           definition_block ::= * para defs
           defs ::= * defs def
@@ -109,66 +110,66 @@ State 0:
 
                        LINE_HR shift-reduce 9      block ::= LINE_HR
                     LINE_PLAIN shift        16     
-          LINE_TABLE_SEPARATOR shift-reduce 132    row ::= LINE_TABLE_SEPARATOR
-             LINE_INDENTED_TAB shift-reduce 89     indented_line ::= LINE_INDENTED_TAB
-           LINE_INDENTED_SPACE shift-reduce 90     indented_line ::= LINE_INDENTED_SPACE
-                    LINE_TABLE shift-reduce 128    header_rows ::= LINE_TABLE
-                     LINE_HTML shift-reduce 117    html_block ::= LINE_HTML
+          LINE_TABLE_SEPARATOR shift-reduce 133    row ::= LINE_TABLE_SEPARATOR
+             LINE_INDENTED_TAB shift-reduce 90     indented_line ::= LINE_INDENTED_TAB
+           LINE_INDENTED_SPACE shift-reduce 91     indented_line ::= LINE_INDENTED_SPACE
+                    LINE_TABLE shift-reduce 129    header_rows ::= LINE_TABLE
+                     LINE_HTML shift-reduce 118    html_block ::= LINE_HTML
                     LINE_ATX_1 shift-reduce 3      block ::= LINE_ATX_1
                     LINE_ATX_2 shift-reduce 4      block ::= LINE_ATX_2
                     LINE_ATX_3 shift-reduce 5      block ::= LINE_ATX_3
                     LINE_ATX_4 shift-reduce 6      block ::= LINE_ATX_4
                     LINE_ATX_5 shift-reduce 7      block ::= LINE_ATX_5
                     LINE_ATX_6 shift-reduce 8      block ::= LINE_ATX_6
-               LINE_BLOCKQUOTE shift-reduce 94     blockquote ::= LINE_BLOCKQUOTE
+               LINE_BLOCKQUOTE shift-reduce 95     blockquote ::= LINE_BLOCKQUOTE
             LINE_LIST_BULLETED shift        7      
           LINE_LIST_ENUMERATED shift        6      
-         LINE_DEF_ABBREVIATION shift-reduce 101    def_abbreviation ::= LINE_DEF_ABBREVIATION
+         LINE_DEF_ABBREVIATION shift        17     
              LINE_DEF_CITATION shift        4      
              LINE_DEF_FOOTNOTE shift        3      
              LINE_DEF_GLOSSARY shift        2      
-                 LINE_DEF_LINK shift        17     
+                 LINE_DEF_LINK shift        18     
                       LINE_TOC shift-reduce 10     block ::= LINE_TOC
                LINE_DEFINITION shift        5      
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-         LINE_FENCE_BACKTICK_3 shift-reduce 105    fenced_3 ::= LINE_FENCE_BACKTICK_3
-         LINE_FENCE_BACKTICK_4 shift-reduce 108    fenced_4 ::= LINE_FENCE_BACKTICK_4
-         LINE_FENCE_BACKTICK_5 shift-reduce 111    fenced_5 ::= LINE_FENCE_BACKTICK_5
-   LINE_FENCE_BACKTICK_START_3 shift-reduce 106    fenced_3 ::= LINE_FENCE_BACKTICK_START_3
-   LINE_FENCE_BACKTICK_START_4 shift-reduce 109    fenced_4 ::= LINE_FENCE_BACKTICK_START_4
-   LINE_FENCE_BACKTICK_START_5 shift-reduce 112    fenced_5 ::= LINE_FENCE_BACKTICK_START_5
-                     LINE_META shift-reduce 123    meta_block ::= LINE_META
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+         LINE_FENCE_BACKTICK_3 shift-reduce 106    fenced_3 ::= LINE_FENCE_BACKTICK_3
+         LINE_FENCE_BACKTICK_4 shift-reduce 109    fenced_4 ::= LINE_FENCE_BACKTICK_4
+         LINE_FENCE_BACKTICK_5 shift-reduce 112    fenced_5 ::= LINE_FENCE_BACKTICK_5
+   LINE_FENCE_BACKTICK_START_3 shift-reduce 107    fenced_3 ::= LINE_FENCE_BACKTICK_START_3
+   LINE_FENCE_BACKTICK_START_4 shift-reduce 110    fenced_4 ::= LINE_FENCE_BACKTICK_START_4
+   LINE_FENCE_BACKTICK_START_5 shift-reduce 113    fenced_5 ::= LINE_FENCE_BACKTICK_START_5
+                     LINE_META shift-reduce 124    meta_block ::= LINE_META
                            doc accept
                         blocks shift        1      
                          block shift-reduce 2      blocks ::= block
-                    blockquote shift        31     
+                    blockquote shift        32     
               def_abbreviation shift-reduce 12     block ::= def_abbreviation
                   def_citation shift-reduce 13     block ::= def_citation
                   def_footnote shift-reduce 14     block ::= def_footnote
                   def_glossary shift-reduce 15     block ::= def_glossary
                       def_link shift-reduce 16     block ::= def_link
               definition_block shift-reduce 17     block ::= definition_block
-                         empty shift        41     
+                         empty shift        43     
                   fenced_block shift-reduce 19     block ::= fenced_block
-                    html_block shift        30     
-                 indented_code shift        28     
-                   list_bullet shift        38     
-                     list_enum shift        36     
-                    meta_block shift        29     
+                    html_block shift        31     
+                 indented_code shift        29     
+                   list_bullet shift        40     
+                     list_enum shift        38     
+                    meta_block shift        30     
                           para shift        14     
                       setext_1 shift-reduce 26     block ::= setext_1
                       setext_2 shift-reduce 27     block ::= setext_2
                          table shift-reduce 28     block ::= table
-                 indented_line shift        28       /* because indented_line==indented_code */
-                          defs shift        33     
-                           def shift        33       /* because def==defs */
-                      fenced_3 shift        26     
-                      fenced_4 shift        25     
-                      fenced_5 shift        24     
-                   item_bullet shift        38       /* because item_bullet==list_bullet */
-                     item_enum shift        36       /* because item_enum==list_enum */
+                 indented_line shift        29       /* because indented_line==indented_code */
+                          defs shift        34     
+                           def shift        34       /* because def==defs */
+                      fenced_3 shift        27     
+                      fenced_4 shift        26     
+                      fenced_5 shift        25     
+                   item_bullet shift        40       /* because item_bullet==list_bullet */
+                     item_enum shift        38       /* because item_enum==list_enum */
                   table_header shift        8      
-                   header_rows shift        39     
+                   header_rows shift        41     
                       all_rows shift        15     
                            row shift        15       /* because row==all_rows */
 
@@ -213,6 +214,7 @@ State 1:
           def_glossary ::= * LINE_DEF_GLOSSARY
           def_link ::= * LINE_DEF_LINK chunk
           def_link ::= * LINE_DEF_LINK
+          def_abbreviation ::= * LINE_DEF_ABBREVIATION chunk
           def_abbreviation ::= * LINE_DEF_ABBREVIATION
           definition_block ::= * para defs
           defs ::= * defs def
@@ -283,64 +285,64 @@ State 1:
                              $ reduce       0      doc ::= blocks
                        LINE_HR shift-reduce 9      block ::= LINE_HR
                     LINE_PLAIN shift        16     
-          LINE_TABLE_SEPARATOR shift-reduce 132    row ::= LINE_TABLE_SEPARATOR
-             LINE_INDENTED_TAB shift-reduce 89     indented_line ::= LINE_INDENTED_TAB
-           LINE_INDENTED_SPACE shift-reduce 90     indented_line ::= LINE_INDENTED_SPACE
-                    LINE_TABLE shift-reduce 128    header_rows ::= LINE_TABLE
-                     LINE_HTML shift-reduce 117    html_block ::= LINE_HTML
+          LINE_TABLE_SEPARATOR shift-reduce 133    row ::= LINE_TABLE_SEPARATOR
+             LINE_INDENTED_TAB shift-reduce 90     indented_line ::= LINE_INDENTED_TAB
+           LINE_INDENTED_SPACE shift-reduce 91     indented_line ::= LINE_INDENTED_SPACE
+                    LINE_TABLE shift-reduce 129    header_rows ::= LINE_TABLE
+                     LINE_HTML shift-reduce 118    html_block ::= LINE_HTML
                     LINE_ATX_1 shift-reduce 3      block ::= LINE_ATX_1
                     LINE_ATX_2 shift-reduce 4      block ::= LINE_ATX_2
                     LINE_ATX_3 shift-reduce 5      block ::= LINE_ATX_3
                     LINE_ATX_4 shift-reduce 6      block ::= LINE_ATX_4
                     LINE_ATX_5 shift-reduce 7      block ::= LINE_ATX_5
                     LINE_ATX_6 shift-reduce 8      block ::= LINE_ATX_6
-               LINE_BLOCKQUOTE shift-reduce 94     blockquote ::= LINE_BLOCKQUOTE
+               LINE_BLOCKQUOTE shift-reduce 95     blockquote ::= LINE_BLOCKQUOTE
             LINE_LIST_BULLETED shift        7      
           LINE_LIST_ENUMERATED shift        6      
-         LINE_DEF_ABBREVIATION shift-reduce 101    def_abbreviation ::= LINE_DEF_ABBREVIATION
+         LINE_DEF_ABBREVIATION shift        17     
              LINE_DEF_CITATION shift        4      
              LINE_DEF_FOOTNOTE shift        3      
              LINE_DEF_GLOSSARY shift        2      
-                 LINE_DEF_LINK shift        17     
+                 LINE_DEF_LINK shift        18     
                       LINE_TOC shift-reduce 10     block ::= LINE_TOC
                LINE_DEFINITION shift        5      
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-         LINE_FENCE_BACKTICK_3 shift-reduce 105    fenced_3 ::= LINE_FENCE_BACKTICK_3
-         LINE_FENCE_BACKTICK_4 shift-reduce 108    fenced_4 ::= LINE_FENCE_BACKTICK_4
-         LINE_FENCE_BACKTICK_5 shift-reduce 111    fenced_5 ::= LINE_FENCE_BACKTICK_5
-   LINE_FENCE_BACKTICK_START_3 shift-reduce 106    fenced_3 ::= LINE_FENCE_BACKTICK_START_3
-   LINE_FENCE_BACKTICK_START_4 shift-reduce 109    fenced_4 ::= LINE_FENCE_BACKTICK_START_4
-   LINE_FENCE_BACKTICK_START_5 shift-reduce 112    fenced_5 ::= LINE_FENCE_BACKTICK_START_5
-                     LINE_META shift-reduce 123    meta_block ::= LINE_META
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+         LINE_FENCE_BACKTICK_3 shift-reduce 106    fenced_3 ::= LINE_FENCE_BACKTICK_3
+         LINE_FENCE_BACKTICK_4 shift-reduce 109    fenced_4 ::= LINE_FENCE_BACKTICK_4
+         LINE_FENCE_BACKTICK_5 shift-reduce 112    fenced_5 ::= LINE_FENCE_BACKTICK_5
+   LINE_FENCE_BACKTICK_START_3 shift-reduce 107    fenced_3 ::= LINE_FENCE_BACKTICK_START_3
+   LINE_FENCE_BACKTICK_START_4 shift-reduce 110    fenced_4 ::= LINE_FENCE_BACKTICK_START_4
+   LINE_FENCE_BACKTICK_START_5 shift-reduce 113    fenced_5 ::= LINE_FENCE_BACKTICK_START_5
+                     LINE_META shift-reduce 124    meta_block ::= LINE_META
                          block shift-reduce 1      blocks ::= blocks block
-                    blockquote shift        31     
+                    blockquote shift        32     
               def_abbreviation shift-reduce 12     block ::= def_abbreviation
                   def_citation shift-reduce 13     block ::= def_citation
                   def_footnote shift-reduce 14     block ::= def_footnote
                   def_glossary shift-reduce 15     block ::= def_glossary
                       def_link shift-reduce 16     block ::= def_link
               definition_block shift-reduce 17     block ::= definition_block
-                         empty shift        41     
+                         empty shift        43     
                   fenced_block shift-reduce 19     block ::= fenced_block
-                    html_block shift        30     
-                 indented_code shift        28     
-                   list_bullet shift        38     
-                     list_enum shift        36     
-                    meta_block shift        29     
+                    html_block shift        31     
+                 indented_code shift        29     
+                   list_bullet shift        40     
+                     list_enum shift        38     
+                    meta_block shift        30     
                           para shift        14     
                       setext_1 shift-reduce 26     block ::= setext_1
                       setext_2 shift-reduce 27     block ::= setext_2
                          table shift-reduce 28     block ::= table
-                 indented_line shift        28       /* because indented_line==indented_code */
-                          defs shift        33     
-                           def shift        33       /* because def==defs */
-                      fenced_3 shift        26     
-                      fenced_4 shift        25     
-                      fenced_5 shift        24     
-                   item_bullet shift        38       /* because item_bullet==list_bullet */
-                     item_enum shift        36       /* because item_enum==list_enum */
+                 indented_line shift        29       /* because indented_line==indented_code */
+                          defs shift        34     
+                           def shift        34       /* because def==defs */
+                      fenced_3 shift        27     
+                      fenced_4 shift        26     
+                      fenced_5 shift        25     
+                   item_bullet shift        40       /* because item_bullet==list_bullet */
+                     item_enum shift        38       /* because item_enum==list_enum */
                   table_header shift        8      
-                   header_rows shift        39     
+                   header_rows shift        41     
                       all_rows shift        15     
                            row shift        15       /* because row==all_rows */
 
@@ -358,21 +360,21 @@ State 2:
           tail ::= * opt_ext_chunk
           tail ::= * nested_chunks
           def_glossary ::= LINE_DEF_GLOSSARY * tail
-     (99) def_glossary ::= LINE_DEF_GLOSSARY *
+    (100) def_glossary ::= LINE_DEF_GLOSSARY *
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       99      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       100     ** Parsing conflict **
+                         empty shift        28     
                          chunk shift        10     
                     chunk_line shift        10       /* because chunk_line==chunk */
-                 nested_chunks shift        18     
-                  nested_chunk shift        18       /* because nested_chunk==nested_chunks */
+                 nested_chunks shift        19     
+                  nested_chunk shift        19       /* because nested_chunk==nested_chunks */
                  opt_ext_chunk shift-reduce 38     def_glossary ::= LINE_DEF_GLOSSARY tail  /* because opt_ext_chunk==tail */
                           tail shift-reduce 38     def_glossary ::= LINE_DEF_GLOSSARY tail
-                     {default} reduce       99     def_glossary ::= LINE_DEF_GLOSSARY
+                     {default} reduce       100    def_glossary ::= LINE_DEF_GLOSSARY
 
 State 3:
           chunk ::= * chunk chunk_line
@@ -388,21 +390,21 @@ State 3:
           tail ::= * opt_ext_chunk
           tail ::= * nested_chunks
           def_footnote ::= LINE_DEF_FOOTNOTE * tail
-     (98) def_footnote ::= LINE_DEF_FOOTNOTE *
+     (99) def_footnote ::= LINE_DEF_FOOTNOTE *
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       98      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       99      ** Parsing conflict **
+                         empty shift        28     
                          chunk shift        10     
                     chunk_line shift        10       /* because chunk_line==chunk */
-                 nested_chunks shift        18     
-                  nested_chunk shift        18       /* because nested_chunk==nested_chunks */
+                 nested_chunks shift        19     
+                  nested_chunk shift        19       /* because nested_chunk==nested_chunks */
                  opt_ext_chunk shift-reduce 37     def_footnote ::= LINE_DEF_FOOTNOTE tail  /* because opt_ext_chunk==tail */
                           tail shift-reduce 37     def_footnote ::= LINE_DEF_FOOTNOTE tail
-                     {default} reduce       98     def_footnote ::= LINE_DEF_FOOTNOTE
+                     {default} reduce       99     def_footnote ::= LINE_DEF_FOOTNOTE
 
 State 4:
           chunk ::= * chunk chunk_line
@@ -418,21 +420,21 @@ State 4:
           tail ::= * opt_ext_chunk
           tail ::= * nested_chunks
           def_citation ::= LINE_DEF_CITATION * tail
-     (97) def_citation ::= LINE_DEF_CITATION *
+     (98) def_citation ::= LINE_DEF_CITATION *
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       97      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       98      ** Parsing conflict **
+                         empty shift        28     
                          chunk shift        10     
                     chunk_line shift        10       /* because chunk_line==chunk */
-                 nested_chunks shift        18     
-                  nested_chunk shift        18       /* because nested_chunk==nested_chunks */
+                 nested_chunks shift        19     
+                  nested_chunk shift        19       /* because nested_chunk==nested_chunks */
                  opt_ext_chunk shift-reduce 36     def_citation ::= LINE_DEF_CITATION tail  /* because opt_ext_chunk==tail */
                           tail shift-reduce 36     def_citation ::= LINE_DEF_CITATION tail
-                     {default} reduce       97     def_citation ::= LINE_DEF_CITATION
+                     {default} reduce       98     def_citation ::= LINE_DEF_CITATION
 
 State 5:
           chunk ::= * chunk chunk_line
@@ -448,21 +450,21 @@ State 5:
           tail ::= * opt_ext_chunk
           tail ::= * nested_chunks
           def ::= LINE_DEFINITION * tail
-     (43) def ::= LINE_DEFINITION *
+     (44) def ::= LINE_DEFINITION *
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       43      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       44      ** Parsing conflict **
+                         empty shift        28     
                          chunk shift        10     
                     chunk_line shift        10       /* because chunk_line==chunk */
-                 nested_chunks shift        18     
-                  nested_chunk shift        18       /* because nested_chunk==nested_chunks */
-                 opt_ext_chunk shift-reduce 42     def ::= LINE_DEFINITION tail  /* because opt_ext_chunk==tail */
-                          tail shift-reduce 42     def ::= LINE_DEFINITION tail
-                     {default} reduce       43     def ::= LINE_DEFINITION
+                 nested_chunks shift        19     
+                  nested_chunk shift        19       /* because nested_chunk==nested_chunks */
+                 opt_ext_chunk shift-reduce 43     def ::= LINE_DEFINITION tail  /* because opt_ext_chunk==tail */
+                          tail shift-reduce 43     def ::= LINE_DEFINITION tail
+                     {default} reduce       44     def ::= LINE_DEFINITION
 
 State 6:
           chunk ::= * chunk chunk_line
@@ -479,18 +481,18 @@ State 6:
           item_enum ::= LINE_LIST_ENUMERATED * ext_chunk
           item_enum ::= LINE_LIST_ENUMERATED * chunk
           item_enum ::= LINE_LIST_ENUMERATED * nested_chunks
-     (72) item_enum ::= LINE_LIST_ENUMERATED *
+     (73) item_enum ::= LINE_LIST_ENUMERATED *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       72      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       73      ** Parsing conflict **
+                         empty shift        28     
                          chunk shift        11     
                     chunk_line shift        11       /* because chunk_line==chunk */
-                 nested_chunks shift        20     
-                  nested_chunk shift        20       /* because nested_chunk==nested_chunks */
-                     ext_chunk shift-reduce 69     item_enum ::= LINE_LIST_ENUMERATED ext_chunk
-                     {default} reduce       72     item_enum ::= LINE_LIST_ENUMERATED
+                 nested_chunks shift        21     
+                  nested_chunk shift        21       /* because nested_chunk==nested_chunks */
+                     ext_chunk shift-reduce 70     item_enum ::= LINE_LIST_ENUMERATED ext_chunk
+                     {default} reduce       73     item_enum ::= LINE_LIST_ENUMERATED
 
 State 7:
           chunk ::= * chunk chunk_line
@@ -507,22 +509,22 @@ State 7:
           item_bullet ::= LINE_LIST_BULLETED * ext_chunk
           item_bullet ::= LINE_LIST_BULLETED * chunk
           item_bullet ::= LINE_LIST_BULLETED * nested_chunks
-     (67) item_bullet ::= LINE_LIST_BULLETED *
+     (68) item_bullet ::= LINE_LIST_BULLETED *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       67      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       68      ** Parsing conflict **
+                         empty shift        28     
                          chunk shift        12     
                     chunk_line shift        12       /* because chunk_line==chunk */
-                 nested_chunks shift        21     
-                  nested_chunk shift        21       /* because nested_chunk==nested_chunks */
-                     ext_chunk shift-reduce 64     item_bullet ::= LINE_LIST_BULLETED ext_chunk
-                     {default} reduce       67     item_bullet ::= LINE_LIST_BULLETED
+                 nested_chunks shift        22     
+                  nested_chunk shift        22       /* because nested_chunk==nested_chunks */
+                     ext_chunk shift-reduce 65     item_bullet ::= LINE_LIST_BULLETED ext_chunk
+                     {default} reduce       68     item_bullet ::= LINE_LIST_BULLETED
 
 State 8:
           table ::= table_header * table_body
-    (127) table ::= table_header *
+    (128) table ::= table_header *
           header_rows ::= * header_rows LINE_TABLE
           header_rows ::= * LINE_TABLE
           table_body ::= * table_body table_section
@@ -534,19 +536,19 @@ State 8:
           row ::= * header_rows
           row ::= * LINE_TABLE_SEPARATOR
 
-          LINE_TABLE_SEPARATOR shift-reduce 132    row ::= LINE_TABLE_SEPARATOR
-          LINE_TABLE_SEPARATOR reduce       127     ** Parsing conflict **
-                    LINE_TABLE shift-reduce 128    header_rows ::= LINE_TABLE
-                    LINE_TABLE reduce       127     ** Parsing conflict **
+          LINE_TABLE_SEPARATOR shift-reduce 133    row ::= LINE_TABLE_SEPARATOR
+          LINE_TABLE_SEPARATOR reduce       128     ** Parsing conflict **
+                    LINE_TABLE shift-reduce 129    header_rows ::= LINE_TABLE
+                    LINE_TABLE reduce       128     ** Parsing conflict **
                     table_body shift        9      
-                   header_rows shift        40     
+                   header_rows shift        42     
                  table_section shift        9        /* because table_section==table_body */
                       all_rows shift        13     
                            row shift        13       /* because row==all_rows */
-                     {default} reduce       127    table ::= table_header
+                     {default} reduce       128    table ::= table_header
 
 State 9:
-     (77) table ::= table_header table_body *
+     (78) table ::= table_header table_body *
           header_rows ::= * header_rows LINE_TABLE
           header_rows ::= * LINE_TABLE
           table_body ::= table_body * table_section
@@ -557,15 +559,15 @@ State 9:
           row ::= * header_rows
           row ::= * LINE_TABLE_SEPARATOR
 
-          LINE_TABLE_SEPARATOR shift-reduce 132    row ::= LINE_TABLE_SEPARATOR
-          LINE_TABLE_SEPARATOR reduce       77      ** Parsing conflict **
-                    LINE_TABLE shift-reduce 128    header_rows ::= LINE_TABLE
-                    LINE_TABLE reduce       77      ** Parsing conflict **
-                   header_rows shift        40     
-                 table_section shift-reduce 80     table_body ::= table_body table_section
+          LINE_TABLE_SEPARATOR shift-reduce 133    row ::= LINE_TABLE_SEPARATOR
+          LINE_TABLE_SEPARATOR reduce       78      ** Parsing conflict **
+                    LINE_TABLE shift-reduce 129    header_rows ::= LINE_TABLE
+                    LINE_TABLE reduce       78      ** Parsing conflict **
+                   header_rows shift        42     
+                 table_section shift-reduce 81     table_body ::= table_body table_section
                       all_rows shift        13     
                            row shift        13       /* because row==all_rows */
-                     {default} reduce       77     table ::= table_header table_body
+                     {default} reduce       78     table ::= table_header table_body
 
 State 10:
           chunk ::= chunk * chunk_line
@@ -576,18 +578,18 @@ State 10:
           nested_chunk ::= * empty indented_line
           nested_chunk ::= * empty
           opt_ext_chunk ::= chunk * nested_chunks
-     (91) opt_ext_chunk ::= chunk *
+     (92) opt_ext_chunk ::= chunk *
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       91      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       92      ** Parsing conflict **
+                         empty shift        28     
                     chunk_line shift-reduce 29     chunk ::= chunk chunk_line
-                 nested_chunks shift        19     
-                  nested_chunk shift        19       /* because nested_chunk==nested_chunks */
-                     {default} reduce       91     opt_ext_chunk ::= chunk
+                 nested_chunks shift        20     
+                  nested_chunk shift        20       /* because nested_chunk==nested_chunks */
+                     {default} reduce       92     opt_ext_chunk ::= chunk
 
 State 11:
           chunk ::= chunk * chunk_line
@@ -600,16 +602,16 @@ State 11:
           ext_chunk ::= chunk * nested_chunks
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
-     (70) item_enum ::= LINE_LIST_ENUMERATED chunk *
+     (71) item_enum ::= LINE_LIST_ENUMERATED chunk *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       70      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       71      ** Parsing conflict **
+                         empty shift        28     
                     chunk_line shift-reduce 29     chunk ::= chunk chunk_line
-                 nested_chunks shift        23     
-                  nested_chunk shift        23       /* because nested_chunk==nested_chunks */
-                     {default} reduce       70     item_enum ::= LINE_LIST_ENUMERATED chunk
+                 nested_chunks shift        24     
+                  nested_chunk shift        24       /* because nested_chunk==nested_chunks */
+                     {default} reduce       71     item_enum ::= LINE_LIST_ENUMERATED chunk
 
 State 12:
           chunk ::= chunk * chunk_line
@@ -622,35 +624,35 @@ State 12:
           ext_chunk ::= chunk * nested_chunks
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
-     (65) item_bullet ::= LINE_LIST_BULLETED chunk *
+     (66) item_bullet ::= LINE_LIST_BULLETED chunk *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       65      ** Parsing conflict **
-                         empty shift        27     
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       66      ** Parsing conflict **
+                         empty shift        28     
                     chunk_line shift-reduce 29     chunk ::= chunk chunk_line
-                 nested_chunks shift        23     
-                  nested_chunk shift        23       /* because nested_chunk==nested_chunks */
-                     {default} reduce       65     item_bullet ::= LINE_LIST_BULLETED chunk
+                 nested_chunks shift        24     
+                  nested_chunk shift        24       /* because nested_chunk==nested_chunks */
+                     {default} reduce       66     item_bullet ::= LINE_LIST_BULLETED chunk
 
 State 13:
           header_rows ::= * header_rows LINE_TABLE
           header_rows ::= * LINE_TABLE
           table_section ::= all_rows * LINE_EMPTY
-     (82) table_section ::= all_rows *
+     (83) table_section ::= all_rows *
           all_rows ::= all_rows * row
           row ::= * header_rows
           row ::= * LINE_TABLE_SEPARATOR
 
-          LINE_TABLE_SEPARATOR shift-reduce 132    row ::= LINE_TABLE_SEPARATOR
-          LINE_TABLE_SEPARATOR reduce       82      ** Parsing conflict **
-                    LINE_TABLE shift-reduce 128    header_rows ::= LINE_TABLE
-                    LINE_TABLE reduce       82      ** Parsing conflict **
-                    LINE_EMPTY shift-reduce 81     table_section ::= all_rows LINE_EMPTY
-                    LINE_EMPTY reduce       82      ** Parsing conflict **
-                   header_rows shift        40     
-                           row shift-reduce 83     all_rows ::= all_rows row
-                     {default} reduce       82     table_section ::= all_rows
+          LINE_TABLE_SEPARATOR shift-reduce 133    row ::= LINE_TABLE_SEPARATOR
+          LINE_TABLE_SEPARATOR reduce       83      ** Parsing conflict **
+                    LINE_TABLE shift-reduce 129    header_rows ::= LINE_TABLE
+                    LINE_TABLE reduce       83      ** Parsing conflict **
+                    LINE_EMPTY shift-reduce 82     table_section ::= all_rows LINE_EMPTY
+                    LINE_EMPTY reduce       83      ** Parsing conflict **
+                   header_rows shift        42     
+                           row shift-reduce 84     all_rows ::= all_rows row
+                     {default} reduce       83     table_section ::= all_rows
 
 State 14:
      (25) block ::= para *
@@ -662,12 +664,12 @@ State 14:
           setext_1 ::= para * LINE_SETEXT_1
           setext_2 ::= para * LINE_SETEXT_2
 
-                 LINE_SETEXT_1 shift-reduce 75     setext_1 ::= para LINE_SETEXT_1
-                 LINE_SETEXT_2 shift-reduce 76     setext_2 ::= para LINE_SETEXT_2
+                 LINE_SETEXT_1 shift-reduce 76     setext_1 ::= para LINE_SETEXT_1
+                 LINE_SETEXT_2 shift-reduce 77     setext_2 ::= para LINE_SETEXT_2
                LINE_DEFINITION shift        5      
                LINE_DEFINITION reduce       25      ** Parsing conflict **
-                          defs shift        35     
-                           def shift        35       /* because def==defs */
+                          defs shift        37     
+                           def shift        37       /* because def==defs */
                      {default} reduce       25     block ::= para
 
 State 15:
@@ -676,56 +678,68 @@ State 15:
           all_rows ::= all_rows * row
           row ::= * header_rows
           row ::= * LINE_TABLE_SEPARATOR
-     (84) para ::= all_rows *
+     (85) para ::= all_rows *
 
-          LINE_TABLE_SEPARATOR shift-reduce 132    row ::= LINE_TABLE_SEPARATOR
-          LINE_TABLE_SEPARATOR reduce       84      ** Parsing conflict **
-                    LINE_TABLE shift-reduce 128    header_rows ::= LINE_TABLE
-                    LINE_TABLE reduce       84      ** Parsing conflict **
-                   header_rows shift        40     
-                           row shift-reduce 83     all_rows ::= all_rows row
-                     {default} reduce       84     para ::= all_rows
+          LINE_TABLE_SEPARATOR shift-reduce 133    row ::= LINE_TABLE_SEPARATOR
+          LINE_TABLE_SEPARATOR reduce       85      ** Parsing conflict **
+                    LINE_TABLE shift-reduce 129    header_rows ::= LINE_TABLE
+                    LINE_TABLE reduce       85      ** Parsing conflict **
+                   header_rows shift        42     
+                           row shift-reduce 84     all_rows ::= all_rows row
+                     {default} reduce       85     para ::= all_rows
 
 State 16:
           chunk ::= * chunk chunk_line
           chunk ::= * chunk_line
           chunk_line ::= * LINE_CONTINUATION
           para ::= LINE_PLAIN * chunk
-    (126) para ::= LINE_PLAIN *
+    (127) para ::= LINE_PLAIN *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                         chunk shift        32     
-                    chunk_line shift        32       /* because chunk_line==chunk */
-                     {default} reduce       126    para ::= LINE_PLAIN
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                         chunk shift        33     
+                    chunk_line shift        33       /* because chunk_line==chunk */
+                     {default} reduce       127    para ::= LINE_PLAIN
 
 State 17:
           chunk ::= * chunk chunk_line
           chunk ::= * chunk_line
           chunk_line ::= * LINE_CONTINUATION
-          def_link ::= LINE_DEF_LINK * chunk
-    (100) def_link ::= LINE_DEF_LINK *
+          def_abbreviation ::= LINE_DEF_ABBREVIATION * chunk
+    (102) def_abbreviation ::= LINE_DEF_ABBREVIATION *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                         chunk shift        34     
-                    chunk_line shift        34       /* because chunk_line==chunk */
-                     {default} reduce       100    def_link ::= LINE_DEF_LINK
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                         chunk shift        35     
+                    chunk_line shift        35       /* because chunk_line==chunk */
+                     {default} reduce       102    def_abbreviation ::= LINE_DEF_ABBREVIATION
 
 State 18:
+          chunk ::= * chunk chunk_line
+          chunk ::= * chunk_line
+          chunk_line ::= * LINE_CONTINUATION
+          def_link ::= LINE_DEF_LINK * chunk
+    (101) def_link ::= LINE_DEF_LINK *
+
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                         chunk shift        36     
+                    chunk_line shift        36       /* because chunk_line==chunk */
+                     {default} reduce       101    def_link ::= LINE_DEF_LINK
+
+State 19:
           nested_chunks ::= nested_chunks * nested_chunk
           nested_chunk ::= * empty indented_line chunk
           nested_chunk ::= * empty indented_line
           nested_chunk ::= * empty
-     (93) tail ::= nested_chunks *
+     (94) tail ::= nested_chunks *
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       93      ** Parsing conflict **
-                         empty shift        27     
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       94      ** Parsing conflict **
+                         empty shift        28     
                   nested_chunk shift-reduce 30     nested_chunks ::= nested_chunks nested_chunk
-                     {default} reduce       93     tail ::= nested_chunks
+                     {default} reduce       94     tail ::= nested_chunks
 
-State 19:
+State 20:
           nested_chunks ::= nested_chunks * nested_chunk
           nested_chunk ::= * empty indented_line chunk
           nested_chunk ::= * empty indented_line
@@ -734,55 +748,55 @@ State 19:
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
                     LINE_EMPTY reduce       34      ** Parsing conflict **
-                         empty shift        27     
+                         empty shift        28     
                   nested_chunk shift-reduce 30     nested_chunks ::= nested_chunks nested_chunk
                      {default} reduce       34     opt_ext_chunk ::= chunk nested_chunks
 
-State 20:
+State 21:
           nested_chunks ::= nested_chunks * nested_chunk
           nested_chunk ::= * empty indented_line chunk
           nested_chunk ::= * empty indented_line
           nested_chunk ::= * empty
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
-     (71) item_enum ::= LINE_LIST_ENUMERATED nested_chunks *
+     (72) item_enum ::= LINE_LIST_ENUMERATED nested_chunks *
 
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       71      ** Parsing conflict **
-                         empty shift        27     
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       72      ** Parsing conflict **
+                         empty shift        28     
                   nested_chunk shift-reduce 30     nested_chunks ::= nested_chunks nested_chunk
-                     {default} reduce       71     item_enum ::= LINE_LIST_ENUMERATED nested_chunks
+                     {default} reduce       72     item_enum ::= LINE_LIST_ENUMERATED nested_chunks
 
-State 21:
+State 22:
           nested_chunks ::= nested_chunks * nested_chunk
           nested_chunk ::= * empty indented_line chunk
           nested_chunk ::= * empty indented_line
           nested_chunk ::= * empty
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
-     (66) item_bullet ::= LINE_LIST_BULLETED nested_chunks *
+     (67) item_bullet ::= LINE_LIST_BULLETED nested_chunks *
 
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
-                    LINE_EMPTY reduce       66      ** Parsing conflict **
-                         empty shift        27     
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
+                    LINE_EMPTY reduce       67      ** Parsing conflict **
+                         empty shift        28     
                   nested_chunk shift-reduce 30     nested_chunks ::= nested_chunks nested_chunk
-                     {default} reduce       66     item_bullet ::= LINE_LIST_BULLETED nested_chunks
+                     {default} reduce       67     item_bullet ::= LINE_LIST_BULLETED nested_chunks
 
-State 22:
+State 23:
           chunk ::= * chunk chunk_line
           chunk ::= * chunk_line
           chunk_line ::= * LINE_CONTINUATION
           nested_chunk ::= empty indented_line * chunk
      (32) nested_chunk ::= empty indented_line *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
-                         chunk shift        37     
-                    chunk_line shift        37       /* because chunk_line==chunk */
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                         chunk shift        39     
+                    chunk_line shift        39       /* because chunk_line==chunk */
                      {default} reduce       32     nested_chunk ::= empty indented_line
 
-State 23:
+State 24:
           nested_chunks ::= nested_chunks * nested_chunk
           nested_chunk ::= * empty indented_line chunk
           nested_chunk ::= * empty indented_line
@@ -791,15 +805,15 @@ State 23:
           empty ::= * empty LINE_EMPTY
           empty ::= * LINE_EMPTY
 
-                    LINE_EMPTY shift-reduce 103    empty ::= LINE_EMPTY
+                    LINE_EMPTY shift-reduce 104    empty ::= LINE_EMPTY
                     LINE_EMPTY reduce       33      ** Parsing conflict **
-                         empty shift        27     
+                         empty shift        28     
                   nested_chunk shift-reduce 30     nested_chunks ::= nested_chunks nested_chunk
                      {default} reduce       33     ext_chunk ::= chunk nested_chunks
 
-State 24:
+State 25:
           fenced_block ::= fenced_5 * LINE_FENCE_BACKTICK_5
-    (110) fenced_block ::= fenced_5 *
+    (111) fenced_block ::= fenced_5 *
           fenced_5 ::= fenced_5 * fenced_line
           fenced_5 ::= fenced_5 * LINE_FENCE_BACKTICK_3
           fenced_5 ::= fenced_5 * LINE_FENCE_BACKTICK_START_3
@@ -810,28 +824,28 @@ State 24:
           fenced_line ::= * LINE_SETEXT_1
           fenced_line ::= * LINE_SETEXT_2
 
-                 LINE_SETEXT_1 shift-reduce 115    fenced_line ::= LINE_SETEXT_1
-                 LINE_SETEXT_2 shift-reduce 116    fenced_line ::= LINE_SETEXT_2
-             LINE_CONTINUATION shift-reduce 113    fenced_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 114    fenced_line ::= LINE_EMPTY
-                    LINE_EMPTY reduce       110     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_3 shift-reduce 56     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_3
-         LINE_FENCE_BACKTICK_3 reduce       110     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_4 shift-reduce 58     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_4
-         LINE_FENCE_BACKTICK_4 reduce       110     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_5 shift-reduce 54     fenced_block ::= fenced_5 LINE_FENCE_BACKTICK_5
-         LINE_FENCE_BACKTICK_5 reduce       110     ** Parsing conflict **
-   LINE_FENCE_BACKTICK_START_3 shift-reduce 57     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_3
-   LINE_FENCE_BACKTICK_START_3 reduce       110     ** Parsing conflict **
-   LINE_FENCE_BACKTICK_START_4 shift-reduce 59     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_4
-   LINE_FENCE_BACKTICK_START_4 reduce       110     ** Parsing conflict **
-                   fenced_line shift-reduce 55     fenced_5 ::= fenced_5 fenced_line
-                     {default} reduce       110    fenced_block ::= fenced_5
+                 LINE_SETEXT_1 shift-reduce 116    fenced_line ::= LINE_SETEXT_1
+                 LINE_SETEXT_2 shift-reduce 117    fenced_line ::= LINE_SETEXT_2
+             LINE_CONTINUATION shift-reduce 114    fenced_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 115    fenced_line ::= LINE_EMPTY
+                    LINE_EMPTY reduce       111     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_3 shift-reduce 57     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_3
+         LINE_FENCE_BACKTICK_3 reduce       111     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_4 shift-reduce 59     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_4
+         LINE_FENCE_BACKTICK_4 reduce       111     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_5 shift-reduce 55     fenced_block ::= fenced_5 LINE_FENCE_BACKTICK_5
+         LINE_FENCE_BACKTICK_5 reduce       111     ** Parsing conflict **
+   LINE_FENCE_BACKTICK_START_3 shift-reduce 58     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_3
+   LINE_FENCE_BACKTICK_START_3 reduce       111     ** Parsing conflict **
+   LINE_FENCE_BACKTICK_START_4 shift-reduce 60     fenced_5 ::= fenced_5 LINE_FENCE_BACKTICK_START_4
+   LINE_FENCE_BACKTICK_START_4 reduce       111     ** Parsing conflict **
+                   fenced_line shift-reduce 56     fenced_5 ::= fenced_5 fenced_line
+                     {default} reduce       111    fenced_block ::= fenced_5
 
-State 25:
+State 26:
           fenced_block ::= fenced_4 * LINE_FENCE_BACKTICK_4
           fenced_block ::= fenced_4 * LINE_FENCE_BACKTICK_5
-    (107) fenced_block ::= fenced_4 *
+    (108) fenced_block ::= fenced_4 *
           fenced_4 ::= fenced_4 * fenced_line
           fenced_4 ::= fenced_4 * LINE_FENCE_BACKTICK_3
           fenced_4 ::= fenced_4 * LINE_FENCE_BACKTICK_START_3
@@ -840,157 +854,166 @@ State 25:
           fenced_line ::= * LINE_SETEXT_1
           fenced_line ::= * LINE_SETEXT_2
 
-                 LINE_SETEXT_1 shift-reduce 115    fenced_line ::= LINE_SETEXT_1
-                 LINE_SETEXT_2 shift-reduce 116    fenced_line ::= LINE_SETEXT_2
-             LINE_CONTINUATION shift-reduce 113    fenced_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 114    fenced_line ::= LINE_EMPTY
-                    LINE_EMPTY reduce       107     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_3 shift-reduce 52     fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_3
-         LINE_FENCE_BACKTICK_3 reduce       107     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_4 shift-reduce 49     fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_4
-         LINE_FENCE_BACKTICK_4 reduce       107     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_5 shift-reduce 50     fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_5
-         LINE_FENCE_BACKTICK_5 reduce       107     ** Parsing conflict **
-   LINE_FENCE_BACKTICK_START_3 shift-reduce 53     fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_START_3
-   LINE_FENCE_BACKTICK_START_3 reduce       107     ** Parsing conflict **
-                   fenced_line shift-reduce 51     fenced_4 ::= fenced_4 fenced_line
-                     {default} reduce       107    fenced_block ::= fenced_4
+                 LINE_SETEXT_1 shift-reduce 116    fenced_line ::= LINE_SETEXT_1
+                 LINE_SETEXT_2 shift-reduce 117    fenced_line ::= LINE_SETEXT_2
+             LINE_CONTINUATION shift-reduce 114    fenced_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 115    fenced_line ::= LINE_EMPTY
+                    LINE_EMPTY reduce       108     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_3 shift-reduce 53     fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_3
+         LINE_FENCE_BACKTICK_3 reduce       108     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_4 shift-reduce 50     fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_4
+         LINE_FENCE_BACKTICK_4 reduce       108     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_5 shift-reduce 51     fenced_block ::= fenced_4 LINE_FENCE_BACKTICK_5
+         LINE_FENCE_BACKTICK_5 reduce       108     ** Parsing conflict **
+   LINE_FENCE_BACKTICK_START_3 shift-reduce 54     fenced_4 ::= fenced_4 LINE_FENCE_BACKTICK_START_3
+   LINE_FENCE_BACKTICK_START_3 reduce       108     ** Parsing conflict **
+                   fenced_line shift-reduce 52     fenced_4 ::= fenced_4 fenced_line
+                     {default} reduce       108    fenced_block ::= fenced_4
 
-State 26:
+State 27:
           fenced_block ::= fenced_3 * LINE_FENCE_BACKTICK_3
           fenced_block ::= fenced_3 * LINE_FENCE_BACKTICK_4
           fenced_block ::= fenced_3 * LINE_FENCE_BACKTICK_5
-    (104) fenced_block ::= fenced_3 *
+    (105) fenced_block ::= fenced_3 *
           fenced_3 ::= fenced_3 * fenced_line
           fenced_line ::= * LINE_CONTINUATION
           fenced_line ::= * LINE_EMPTY
           fenced_line ::= * LINE_SETEXT_1
           fenced_line ::= * LINE_SETEXT_2
 
-                 LINE_SETEXT_1 shift-reduce 115    fenced_line ::= LINE_SETEXT_1
-                 LINE_SETEXT_2 shift-reduce 116    fenced_line ::= LINE_SETEXT_2
-             LINE_CONTINUATION shift-reduce 113    fenced_line ::= LINE_CONTINUATION
-                    LINE_EMPTY shift-reduce 114    fenced_line ::= LINE_EMPTY
-                    LINE_EMPTY reduce       104     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_3 shift-reduce 45     fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_3
-         LINE_FENCE_BACKTICK_3 reduce       104     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_4 shift-reduce 46     fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_4
-         LINE_FENCE_BACKTICK_4 reduce       104     ** Parsing conflict **
-         LINE_FENCE_BACKTICK_5 shift-reduce 47     fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_5
-         LINE_FENCE_BACKTICK_5 reduce       104     ** Parsing conflict **
-                   fenced_line shift-reduce 48     fenced_3 ::= fenced_3 fenced_line
-                     {default} reduce       104    fenced_block ::= fenced_3
+                 LINE_SETEXT_1 shift-reduce 116    fenced_line ::= LINE_SETEXT_1
+                 LINE_SETEXT_2 shift-reduce 117    fenced_line ::= LINE_SETEXT_2
+             LINE_CONTINUATION shift-reduce 114    fenced_line ::= LINE_CONTINUATION
+                    LINE_EMPTY shift-reduce 115    fenced_line ::= LINE_EMPTY
+                    LINE_EMPTY reduce       105     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_3 shift-reduce 46     fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_3
+         LINE_FENCE_BACKTICK_3 reduce       105     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_4 shift-reduce 47     fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_4
+         LINE_FENCE_BACKTICK_4 reduce       105     ** Parsing conflict **
+         LINE_FENCE_BACKTICK_5 shift-reduce 48     fenced_block ::= fenced_3 LINE_FENCE_BACKTICK_5
+         LINE_FENCE_BACKTICK_5 reduce       105     ** Parsing conflict **
+                   fenced_line shift-reduce 49     fenced_3 ::= fenced_3 fenced_line
+                     {default} reduce       105    fenced_block ::= fenced_3
 
-State 27:
+State 28:
           nested_chunk ::= empty * indented_line chunk
           nested_chunk ::= empty * indented_line
-     (88) nested_chunk ::= empty *
+     (89) nested_chunk ::= empty *
           indented_line ::= * LINE_INDENTED_TAB
           indented_line ::= * LINE_INDENTED_SPACE
           empty ::= empty * LINE_EMPTY
 
-             LINE_INDENTED_TAB shift-reduce 89     indented_line ::= LINE_INDENTED_TAB
-             LINE_INDENTED_TAB reduce       88      ** Parsing conflict **
-           LINE_INDENTED_SPACE shift-reduce 90     indented_line ::= LINE_INDENTED_SPACE
-           LINE_INDENTED_SPACE reduce       88      ** Parsing conflict **
-                    LINE_EMPTY shift-reduce 44     empty ::= empty LINE_EMPTY
-                    LINE_EMPTY reduce       88      ** Parsing conflict **
-                 indented_line shift        22     
-                     {default} reduce       88     nested_chunk ::= empty
+             LINE_INDENTED_TAB shift-reduce 90     indented_line ::= LINE_INDENTED_TAB
+             LINE_INDENTED_TAB reduce       89      ** Parsing conflict **
+           LINE_INDENTED_SPACE shift-reduce 91     indented_line ::= LINE_INDENTED_SPACE
+           LINE_INDENTED_SPACE reduce       89      ** Parsing conflict **
+                    LINE_EMPTY shift-reduce 45     empty ::= empty LINE_EMPTY
+                    LINE_EMPTY reduce       89      ** Parsing conflict **
+                 indented_line shift        23     
+                     {default} reduce       89     nested_chunk ::= empty
 
-State 28:
+State 29:
      (21) block ::= indented_code *
           indented_line ::= * LINE_INDENTED_TAB
           indented_line ::= * LINE_INDENTED_SPACE
           indented_code ::= indented_code * indented_line
           indented_code ::= indented_code * LINE_EMPTY
 
-             LINE_INDENTED_TAB shift-reduce 89     indented_line ::= LINE_INDENTED_TAB
+             LINE_INDENTED_TAB shift-reduce 90     indented_line ::= LINE_INDENTED_TAB
              LINE_INDENTED_TAB reduce       21      ** Parsing conflict **
-           LINE_INDENTED_SPACE shift-reduce 90     indented_line ::= LINE_INDENTED_SPACE
+           LINE_INDENTED_SPACE shift-reduce 91     indented_line ::= LINE_INDENTED_SPACE
            LINE_INDENTED_SPACE reduce       21      ** Parsing conflict **
-                    LINE_EMPTY shift-reduce 62     indented_code ::= indented_code LINE_EMPTY
+                    LINE_EMPTY shift-reduce 63     indented_code ::= indented_code LINE_EMPTY
                     LINE_EMPTY reduce       21      ** Parsing conflict **
-                 indented_line shift-reduce 61     indented_code ::= indented_code indented_line
+                 indented_line shift-reduce 62     indented_code ::= indented_code indented_line
                      {default} reduce       21     block ::= indented_code
 
-State 29:
+State 30:
      (24) block ::= meta_block *
           meta_block ::= meta_block * meta_line
           meta_line ::= * LINE_META
           meta_line ::= * LINE_CONTINUATION
 
-             LINE_CONTINUATION shift-reduce 125    meta_line ::= LINE_CONTINUATION
-                     LINE_META shift-reduce 124    meta_line ::= LINE_META
+             LINE_CONTINUATION shift-reduce 126    meta_line ::= LINE_CONTINUATION
+                     LINE_META shift-reduce 125    meta_line ::= LINE_META
                      LINE_META reduce       24      ** Parsing conflict **
-                     meta_line shift-reduce 73     meta_block ::= meta_block meta_line
+                     meta_line shift-reduce 74     meta_block ::= meta_block meta_line
                      {default} reduce       24     block ::= meta_block
 
-State 30:
+State 31:
      (20) block ::= html_block *
           html_block ::= html_block * html_line
           html_line ::= * LINE_CONTINUATION
           html_line ::= * LINE_HTML
 
-             LINE_CONTINUATION shift-reduce 118    html_line ::= LINE_CONTINUATION
-                     LINE_HTML shift-reduce 119    html_line ::= LINE_HTML
+             LINE_CONTINUATION shift-reduce 119    html_line ::= LINE_CONTINUATION
+                     LINE_HTML shift-reduce 120    html_line ::= LINE_HTML
                      LINE_HTML reduce       20      ** Parsing conflict **
-                     html_line shift-reduce 60     html_block ::= html_block html_line
+                     html_line shift-reduce 61     html_block ::= html_block html_line
                      {default} reduce       20     block ::= html_block
 
-State 31:
+State 32:
      (11) block ::= blockquote *
           blockquote ::= blockquote * quote_line
           quote_line ::= * LINE_BLOCKQUOTE
           quote_line ::= * LINE_CONTINUATION
 
-             LINE_CONTINUATION shift-reduce 96     quote_line ::= LINE_CONTINUATION
-               LINE_BLOCKQUOTE shift-reduce 95     quote_line ::= LINE_BLOCKQUOTE
+             LINE_CONTINUATION shift-reduce 97     quote_line ::= LINE_CONTINUATION
+               LINE_BLOCKQUOTE shift-reduce 96     quote_line ::= LINE_BLOCKQUOTE
                LINE_BLOCKQUOTE reduce       11      ** Parsing conflict **
                     quote_line shift-reduce 35     blockquote ::= blockquote quote_line
                      {default} reduce       11     block ::= blockquote
 
-State 32:
+State 33:
           chunk ::= chunk * chunk_line
           chunk_line ::= * LINE_CONTINUATION
-     (74) para ::= LINE_PLAIN chunk *
+     (75) para ::= LINE_PLAIN chunk *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
                     chunk_line shift-reduce 29     chunk ::= chunk chunk_line
-                     {default} reduce       74     para ::= LINE_PLAIN chunk
+                     {default} reduce       75     para ::= LINE_PLAIN chunk
 
-State 33:
+State 34:
           defs ::= defs * def
           def ::= * LINE_DEFINITION tail
           def ::= * LINE_DEFINITION
-    (133) para ::= defs *
+    (134) para ::= defs *
 
                LINE_DEFINITION shift        5      
-               LINE_DEFINITION reduce       133     ** Parsing conflict **
-                           def shift-reduce 41     defs ::= defs def
-                     {default} reduce       133    para ::= defs
+               LINE_DEFINITION reduce       134     ** Parsing conflict **
+                           def shift-reduce 42     defs ::= defs def
+                     {default} reduce       134    para ::= defs
 
-State 34:
+State 35:
+          chunk ::= chunk * chunk_line
+          chunk_line ::= * LINE_CONTINUATION
+     (40) def_abbreviation ::= LINE_DEF_ABBREVIATION chunk *
+
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
+                    chunk_line shift-reduce 29     chunk ::= chunk chunk_line
+                     {default} reduce       40     def_abbreviation ::= LINE_DEF_ABBREVIATION chunk
+
+State 36:
           chunk ::= chunk * chunk_line
           chunk_line ::= * LINE_CONTINUATION
      (39) def_link ::= LINE_DEF_LINK chunk *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
                     chunk_line shift-reduce 29     chunk ::= chunk chunk_line
                      {default} reduce       39     def_link ::= LINE_DEF_LINK chunk
 
-State 35:
-     (40) definition_block ::= para defs *
+State 37:
+     (41) definition_block ::= para defs *
           defs ::= defs * def
           def ::= * LINE_DEFINITION tail
           def ::= * LINE_DEFINITION
 
                LINE_DEFINITION shift        5      
-               LINE_DEFINITION reduce       40      ** Parsing conflict **
-                           def shift-reduce 41     defs ::= defs def
-                     {default} reduce       40     definition_block ::= para defs
+               LINE_DEFINITION reduce       41      ** Parsing conflict **
+                           def shift-reduce 42     defs ::= defs def
+                     {default} reduce       41     definition_block ::= para defs
 
-State 36:
+State 38:
      (23) block ::= list_enum *
           list_enum ::= list_enum * item_enum
           item_enum ::= * LINE_LIST_ENUMERATED ext_chunk
@@ -1000,19 +1023,19 @@ State 36:
 
           LINE_LIST_ENUMERATED shift        6      
           LINE_LIST_ENUMERATED reduce       23      ** Parsing conflict **
-                     item_enum shift-reduce 68     list_enum ::= list_enum item_enum
+                     item_enum shift-reduce 69     list_enum ::= list_enum item_enum
                      {default} reduce       23     block ::= list_enum
 
-State 37:
+State 39:
           chunk ::= chunk * chunk_line
           chunk_line ::= * LINE_CONTINUATION
      (31) nested_chunk ::= empty indented_line chunk *
 
-             LINE_CONTINUATION shift-reduce 86     chunk_line ::= LINE_CONTINUATION
+             LINE_CONTINUATION shift-reduce 87     chunk_line ::= LINE_CONTINUATION
                     chunk_line shift-reduce 29     chunk ::= chunk chunk_line
                      {default} reduce       31     nested_chunk ::= empty indented_line chunk
 
-State 38:
+State 40:
      (22) block ::= list_bullet *
           list_bullet ::= list_bullet * item_bullet
           item_bullet ::= * LINE_LIST_BULLETED ext_chunk
@@ -1022,33 +1045,33 @@ State 38:
 
             LINE_LIST_BULLETED shift        7      
             LINE_LIST_BULLETED reduce       22      ** Parsing conflict **
-                   item_bullet shift-reduce 63     list_bullet ::= list_bullet item_bullet
+                   item_bullet shift-reduce 64     list_bullet ::= list_bullet item_bullet
                      {default} reduce       22     block ::= list_bullet
 
-State 39:
+State 41:
           table_header ::= header_rows * LINE_TABLE_SEPARATOR
           header_rows ::= header_rows * LINE_TABLE
-    (131) row ::= header_rows *
+    (132) row ::= header_rows *
 
-          LINE_TABLE_SEPARATOR shift-reduce 78     table_header ::= header_rows LINE_TABLE_SEPARATOR
-          LINE_TABLE_SEPARATOR reduce       131     ** Parsing conflict **
-                    LINE_TABLE shift-reduce 79     header_rows ::= header_rows LINE_TABLE
-                    LINE_TABLE reduce       131     ** Parsing conflict **
-                     {default} reduce       131    row ::= header_rows
+          LINE_TABLE_SEPARATOR shift-reduce 79     table_header ::= header_rows LINE_TABLE_SEPARATOR
+          LINE_TABLE_SEPARATOR reduce       132     ** Parsing conflict **
+                    LINE_TABLE shift-reduce 80     header_rows ::= header_rows LINE_TABLE
+                    LINE_TABLE reduce       132     ** Parsing conflict **
+                     {default} reduce       132    row ::= header_rows
 
-State 40:
+State 42:
           header_rows ::= header_rows * LINE_TABLE
-    (131) row ::= header_rows *
+    (132) row ::= header_rows *
 
-                    LINE_TABLE shift-reduce 79     header_rows ::= header_rows LINE_TABLE
-                    LINE_TABLE reduce       131     ** Parsing conflict **
-                     {default} reduce       131    row ::= header_rows
+                    LINE_TABLE shift-reduce 80     header_rows ::= header_rows LINE_TABLE
+                    LINE_TABLE reduce       132     ** Parsing conflict **
+                     {default} reduce       132    row ::= header_rows
 
-State 41:
+State 43:
      (18) block ::= empty *
           empty ::= empty * LINE_EMPTY
 
-                    LINE_EMPTY shift-reduce 44     empty ::= empty LINE_EMPTY
+                    LINE_EMPTY shift-reduce 45     empty ::= empty LINE_EMPTY
                     LINE_EMPTY reduce       18      ** Parsing conflict **
                      {default} reduce       18     block ::= empty
 
index 0221e1923f45a1c4e6affe7067e7f8ce0ba352c3..d5f162c4a2b220a6a5af5e01a6f5b92362265b22 100644 (file)
@@ -203,6 +203,7 @@ def_glossary                ::= LINE_DEF_GLOSSARY.
 def_link(A)                    ::= LINE_DEF_LINK(B) chunk(C).                          { A = B; token_chain_append(B, C); }
 def_link                       ::= LINE_DEF_LINK.
 
+def_abbreviation(A)    ::= LINE_DEF_ABBREVIATION(B) chunk(C).          { A = B; token_chain_append(B, C); }
 def_abbreviation       ::= LINE_DEF_ABBREVIATION.
 
 
index 44b1b8f1d8a23fdb31aa67fe5eef2369276d0435..9092f1bf26ad94e4423271a42d5d06eb9070702b 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.14.3 on Thu Mar  2 09:54:25 2017 */
+/* Generated by re2c 0.14.3 on Sat Mar  4 20:43:41 2017 */
 /**
 
        MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more.
@@ -3451,7 +3451,7 @@ size_t scan_ref_abbreviation(const char * c) {
        switch (yych) {
        case '\n':      goto yy144;
        case ' ':       goto yy145;
-       case '*':       goto yy146;
+       case '[':       goto yy146;
        default:        goto yy147;
        }
 yy144:
@@ -3460,13 +3460,13 @@ yy145:
        yych = *(marker = ++c);
        switch (yych) {
        case ' ':       goto yy157;
-       case '*':       goto yy158;
+       case '[':       goto yy158;
        default:        goto yy144;
        }
 yy146:
        yych = *(marker = ++c);
        switch (yych) {
-       case '[':       goto yy148;
+       case '>':       goto yy148;
        default:        goto yy144;
        }
 yy147:
@@ -3521,19 +3521,19 @@ yy157:
        yych = *++c;
        switch (yych) {
        case ' ':       goto yy159;
-       case '*':       goto yy158;
+       case '[':       goto yy158;
        default:        goto yy149;
        }
 yy158:
        yych = *++c;
        switch (yych) {
-       case '[':       goto yy148;
+       case '>':       goto yy148;
        default:        goto yy149;
        }
 yy159:
        ++c;
        switch ((yych = *c)) {
-       case '*':       goto yy158;
+       case '[':       goto yy158;
        default:        goto yy149;
        }
 }
index 7d0e3f99af8064caa29841691fdd3df12a1194a9..1e3f8954ac3c7b991202896dee14485463e7f421 100644 (file)
@@ -89,7 +89,7 @@
        label           = [^\]\n\r\x00]+;
        finish_line     = [^\n\r\x00]+;
 
-       ref_abbr        = non_indent '*[' label ']' ':' finish_line;
+       ref_abbr        = non_indent '[>' label ']' ':' finish_line;
 
        ref_citation    = non_indent '[#' label ']' ':' finish_line;
 
index 7ceb49823d0ce1a669e05f38c094283e4cdb887a..cd8316808279d0b740cddf9d9deef2bdf6d4b364 100644 (file)
@@ -83,8 +83,7 @@ void store_link(scratch_pad * scratch, link * l);
 
 void store_metadata(scratch_pad * scratch, meta * m);
 
-void store_abbreviation(scratch_pad * scratch, abbr * a);
-void abbreviation_free(abbr * a);
+void store_abbreviation(scratch_pad * scratch, footnote * a);
 
 /// strndup not available on all platforms
 static char * my_strndup(const char * source, size_t n) {
@@ -193,6 +192,18 @@ scratch_pad * scratch_pad_new(mmd_engine * e, short format) {
                        store_glossary(p, f);
                }
 
+               // Store abbreviations in a hash for rapid retrieval when exporting
+               p->used_abbreviations = stack_new(0);
+
+               p->abbreviation_hash = NULL;
+
+               for (int i = 0; i < e->abbreviation_stack->size; ++i)
+               {
+                       f = stack_peek_index(e->abbreviation_stack, i);
+
+                       store_abbreviation(p, f);
+               }
+
                // Store metadata in a hash for rapid retrieval when exporting
                p->meta_hash = NULL;
                meta * m;
@@ -203,17 +214,6 @@ scratch_pad * scratch_pad_new(mmd_engine * e, short format) {
 
                        store_metadata(p, m);
                }
-
-               // Store abbreviations in a hash for rapid retrieval when exporting
-               p->abbreviation_hash = NULL;
-               abbr * a;
-
-               for (int i = 0; i < e->abbreviation_stack->size; ++i)
-               {
-                       a = stack_peek_index(e->abbreviation_stack, i);
-
-                       store_abbreviation(p, a);
-               }
        }
 
        return p;
@@ -279,6 +279,14 @@ void scratch_pad_free(scratch_pad * scratch) {
        stack_free(scratch->inline_glossaries_to_free);
 
 
+       // Free abbreviation hash
+       HASH_ITER(hh, scratch->abbreviation_hash, f, f_tmp) {
+               HASH_DEL(scratch->abbreviation_hash, f);        // Remove item from hash
+               free(f);                // Free the fn_holder
+       }
+
+       stack_free(scratch->used_abbreviations);
+
        // Free metadata hash
        meta * m, * m_tmp;
        
@@ -288,14 +296,6 @@ void scratch_pad_free(scratch_pad * scratch) {
                //meta_free(m);
        }
 
-       // Free abbreviation hash
-       abbr * a, * a_tmp;
-
-       HASH_ITER(hh, scratch->abbreviation_hash, a, a_tmp) {
-               HASH_DEL(scratch->abbreviation_hash, a);        // Remove item from hash
-               abbreviation_free(a);
-       }
-
        free(scratch);
 }
 
@@ -722,13 +722,15 @@ void store_metadata(scratch_pad * scratch, meta * m) {
 }
 
 
-void store_abbreviation(scratch_pad * scratch, abbr * a) {
-       abbr * temp;
+void store_abbreviation(scratch_pad * scratch, footnote * f) {
+       fn_holder * temp_holder;
 
-       HASH_FIND_STR(scratch->abbreviation_hash, a->abbr, temp);
+       // Store by `label_text`
+       HASH_FIND_STR(scratch->abbreviation_hash, f->label_text, temp_holder);
 
-       if (!temp) {
-               HASH_ADD_KEYPTR(hh, scratch->abbreviation_hash, a->abbr, strlen(a->abbr), a);
+       if (!temp_holder) {
+               temp_holder = fn_holder_new(f);
+               HASH_ADD_KEYPTR(hh, scratch->abbreviation_hash, f->label_text, strlen(f->label_text), temp_holder);
        }
 }
 
@@ -1216,7 +1218,6 @@ bool definition_extract(mmd_engine * e, token ** remainder) {
 
 void process_definition_block(mmd_engine * e, token * block) {
        footnote * f;
-       abbr * a;
 
        token * label = block->child;
        if (label->type == BLOCK_PARA)
@@ -1226,7 +1227,21 @@ void process_definition_block(mmd_engine * e, token * block) {
                case BLOCK_DEF_CITATION:
                case BLOCK_DEF_FOOTNOTE:
                case BLOCK_DEF_GLOSSARY:
+               case BLOCK_DEF_ABBREVIATION:
                        switch (block->type) {
+                               case BLOCK_DEF_ABBREVIATION:
+                                       // Strip leading '>'' from term
+                                       f = footnote_new(e->dstr->str, label, block->child, false);
+                                       if (f && f->clean_text)
+                                               memmove(f->clean_text, &(f->clean_text)[1],strlen(f->clean_text));
+
+                                       // Adjust the properties
+                                       free(f->label_text);
+                                       f->label_text = f->clean_text;
+                                       f->clean_text = clean_string_from_range(e->dstr->str, f->content->child->next->next->start, block->start + block->len - f->content->child->next->next->start, false);
+
+                                       stack_push(e->abbreviation_stack, f);
+                                       break;
                                case BLOCK_DEF_CITATION:
                                        f = footnote_new(e->dstr->str, label, block->child, true);
                                        stack_push(e->citation_stack, f);
@@ -1251,12 +1266,8 @@ void process_definition_block(mmd_engine * e, token * block) {
                case BLOCK_DEF_LINK:
                        definition_extract(e, &(block->child));
                        break;
-               case BLOCK_DEF_ABBREVIATION:
-                       a = abbr_new(e->dstr->str, label->next, label->next->next->next);
-                       stack_push(e->abbreviation_stack, a);
-                       break;
                default:
-                       fprintf(stderr, "proceess %d\n", block->type);
+                       fprintf(stderr, "process %d\n", block->type);
        }
 
        block->type = BLOCK_EMPTY;
@@ -1592,8 +1603,6 @@ void process_abbreviation_stack(mmd_engine * e, scratch_pad * scratch) {
        for (int i = 0; i < e->abbreviation_stack->size; ++i)
        {
                a = stack_peek_index(e->abbreviation_stack, i);
-
-               fprintf(stderr, "Check for abbreviation: '%s'\n", a->abbr);
        }
 
        abbr_search(e, e->root);
@@ -1811,6 +1820,17 @@ void mark_glossary_as_used(scratch_pad * scratch, footnote * c) {
 }
 
 
+void mark_abbreviation_as_used(scratch_pad * scratch, footnote * c) {
+       if (c->count == -1) {
+               // Add abbreviation to used stack
+               stack_push(scratch->used_abbreviations, c);
+
+               // Update counter
+               c->count = scratch->used_abbreviations->size;
+       }
+}
+
+
 size_t extract_citation_from_stack(scratch_pad * scratch, const char * target) {
        char * key = clean_string(target, true);
 
@@ -1871,6 +1891,36 @@ size_t extract_footnote_from_stack(scratch_pad * scratch, const char * target) {
 }
 
 
+size_t extract_abbreviation_from_stack(scratch_pad * scratch, const char * target) {
+       char * key = clean_string(target, true);
+
+       fn_holder * h;
+
+       HASH_FIND_STR(scratch->abbreviation_hash, key, h);
+
+       free(key);
+
+       if (h) {
+               mark_abbreviation_as_used(scratch, h->note);
+               return h->note->count;
+       }
+
+       key = label_from_string(target);
+
+       HASH_FIND_STR(scratch->abbreviation_hash, key, h);
+
+       free(key);
+
+       if (h) {
+               mark_abbreviation_as_used(scratch, h->note);
+               return h->note->count;
+       }
+
+       // None found
+       return -1;
+}
+
+
 size_t extract_glossary_from_stack(scratch_pad * scratch, const char * target) {
        char * key = clean_string(target, true);
 
@@ -2000,6 +2050,45 @@ void glossary_from_bracket(const char * source, scratch_pad * scratch, token * t
 }
 
 
+void abbreviation_from_bracket(const char * source, scratch_pad * scratch, token * t, short * num) {
+       // Get text inside bracket
+       char * text = text_inside_pair(source, t);
+       short abbr_id = extract_abbreviation_from_stack(scratch, &text[1]);
+       
+       free(text);
+
+       if (abbr_id == -1) {
+               // No match, this is an inline glossary -- create a new glossary entry
+               t->child->type = TEXT_EMPTY;
+               t->child->mate->type = TEXT_EMPTY;
+
+               // Create glossary
+               token * label = t->child;
+               while (label && label->type != PAIR_PAREN)
+                       label = label->next;
+
+               if (label) {
+                       footnote * temp = footnote_new(source, label, label->next, false);
+
+                       // Store as used
+                       stack_push(scratch->used_abbreviations, temp);
+                       *num = scratch->used_abbreviations->size;
+                       temp->count = *num;
+
+                       // We need to free this one later since it doesn't exist
+                       // in the engine's stack, on the scratch_pad stack
+                       //stack_push(scratch->inline_glossaries_to_free, temp);
+               } else {
+                       // Improperly formatted glossary
+                       *num = -1;
+               }
+       } else {
+               // Glossary in stack
+               *num = abbr_id;
+       }
+}
+
+
 void read_table_column_alignments(const char * source, token * table, scratch_pad * scratch) {
        token * walker = table->child->child;
 
index 84b041f339492e59301a41343302e258b099bb8e..3ae4e4facc468e8d62e792abe56a82dfc1164116 100644 (file)
@@ -98,7 +98,8 @@ typedef struct {
        struct fn_holder *      glossary_hash;
        short                           glossary_being_printed;
 
-       struct abbr *           abbreviation_hash;
+       stack *                         used_abbreviations;
+       struct fn_holder *      abbreviation_hash;
 
        short                           language;
        short                           quotes_lang;
@@ -212,6 +213,7 @@ void print_token_tree_raw(DString * out, const char * source, token * t);
 
 char * url_accept(const char * source, size_t start, size_t max_len, size_t * end_pos, bool validate);
 
+void abbreviation_from_bracket(const char * source, scratch_pad * scratch, token * t, short * num);
 void citation_from_bracket(const char * source, scratch_pad * scratch, token * t, short * num);
 void footnote_from_bracket(const char * source, scratch_pad * scratch, token * t, short * num);
 void glossary_from_bracket(const char * source, scratch_pad * scratch, token * t, short * num);
diff --git a/tests/MMD6Tests/Abbreviations.html b/tests/MMD6Tests/Abbreviations.html
new file mode 100644 (file)
index 0000000..888675f
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <meta charset="utf-8"/>
+       <title>Abbreviations</title>
+</head>
+<body>
+
+<p><abbr title="FOO">foo</abbr></p>
+
+<p><abbr title="BAR">bar</abbr></p>
+
+<p><abbr title="FOO">foo</abbr> <abbr title="BAR">bar</abbr></p>
+
+<p><abbr title="FOOBAR">foobar</abbr></p>
+
+<p><abbr title="FOO">foo</abbr>
+<abbr title="BAR">bar</abbr></p>
+
+<p>5</p>
+
+</body>
+</html>
+
diff --git a/tests/MMD6Tests/Abbreviations.htmlc b/tests/MMD6Tests/Abbreviations.htmlc
new file mode 100644 (file)
index 0000000..d830efb
--- /dev/null
@@ -0,0 +1,14 @@
+<p>Title:      Abbreviations
+latex config:  article</p>
+
+<p><a href="FOO">>foo</a></p>
+
+<p><a href="BAR">>bar</a></p>
+
+<p><a href="FOO">>foo</a> <a href="BAR">>bar</a></p>
+
+<p><a href="FOOBAR">>foobar</a></p>
+
+<p><a href="FOOBAR">>foo bar</a></p>
+
+<p>5</p>
diff --git a/tests/MMD6Tests/Abbreviations.tex b/tests/MMD6Tests/Abbreviations.tex
new file mode 100644 (file)
index 0000000..ccd3b43
--- /dev/null
@@ -0,0 +1,27 @@
+\input{mmd6-article-leader}
+\def\mytitle{Abbreviations}
+\newacronym{foo}{foo}{FOO}
+
+\newacronym{bar}{bar}{BAR}
+
+\newacronym{foobar}{foobar}{FOOBAR}
+
+\newacronym{foo bar}{foo bar}{FOO BAR}
+
+\input{mmd6-article-begin}
+
+\gls{foo}
+
+\gls{bar}
+
+\gls{foo} \gls{bar}
+
+\gls{foobar}
+
+\gls{foo}
+\gls{bar}
+
+5
+
+\input{mmd6-article-footer}
+\end{document}