From: Fletcher T. Penney Date: Sun, 12 Feb 2017 15:10:52 +0000 (-0500) Subject: ADDED: Continue LaTeX development X-Git-Tag: 0.3.0a^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54a35753f47697051f259b250e43e89dc5e920ad;p=multimarkdown ADDED: Continue LaTeX development --- diff --git a/src/html.c b/src/html.c index 8d54881..cda764f 100644 --- a/src/html.c +++ b/src/html.c @@ -828,7 +828,12 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t print("="); break; case ESCAPED_CHARACTER: - mmd_print_char_html(out, source[t->start + 1], false); + if (!(scratch->extensions & EXT_COMPATIBILITY) && + (source[t->start + 1] == ' ')) { + print(" "); + } else { + mmd_print_char_html(out, source[t->start + 1], false); + } break; case HASH1: case HASH2: @@ -1243,6 +1248,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t else print_localized(QUOTE_RIGHT_DOUBLE); break; + case SLASH: case STAR: print_token(t); break; diff --git a/src/latex.c b/src/latex.c index 3598a71..90afa2e 100644 --- a/src/latex.c +++ b/src/latex.c @@ -74,6 +74,29 @@ void mmd_print_char_latex(DString * out, char c) { case '\\': print("\\textbackslash{}"); break; + case '~': + print("\\ensuremath{\\sim}"); + break; + case '/': + print("\\slash "); + break; + case '^': + print("\\^{}"); + break; + case '<': + case '>': + print_char('$'); + print_char(c); + print_char('$'); + break; + case '#': + case '{': + case '}': + case '$': + case '%': + case '&': + case '_': + print_char('\\'); default: print_char(c); break; @@ -178,28 +201,26 @@ void mmd_export_link_latex(DString * out, const char * source, token * text, lin attr * a = link->attributes; if (link->url) { - print("url); - print("\""); + printf("\\href{%s}", link->url); } else - print("title && link->title[0] != '\0') { - print(" title=\""); - mmd_print_string_latex(out, link->title); - print("\""); - } +// if (link->title && link->title[0] != '\0') { +// print(" title=\""); +// mmd_print_string_latex(out, link->title); +// print("\""); +// } - while (a) { - print(" "); - print(a->key); - print("=\""); - print(a->value); - print("\""); - a = a->next; - } +// while (a) { +// print(" "); +// print(a->key); +// print("=\""); +// print(a->value); +// print("\""); +// a = a->next; +// } - print(">"); + print("{"); // If we're printing contents of bracket as text, then ensure we include it all if (text && text->child && text->child->len > 1) { @@ -209,7 +230,12 @@ void mmd_export_link_latex(DString * out, const char * source, token * text, lin mmd_export_token_tree_latex(out, source, text->child, scratch); - print(""); + print("}"); + + // Reprint as footnote for printed copies + printf("\\footnote{\\href{%s}{", link->url); + mmd_print_string_latex(out, link->url); + print("}}"); } @@ -281,6 +307,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat char * temp_char2 = NULL; bool temp_bool = 0; token * temp_token = NULL; + footnote * temp_note = NULL; switch (t->type) { case AMPERSAND: @@ -455,6 +482,8 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat mmd_export_token_tree_latex(out, source, t->child, scratch); scratch->padded = 0; break; + case BLOCK_META: + break; case BLOCK_PARA: pad(out, 2, scratch); mmd_export_token_tree_latex(out, source, t->child, scratch); @@ -519,6 +548,9 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case EMPH_STOP: print("}"); break; + case EQUAL: + print("="); + break; case ESCAPED_CHARACTER: mmd_print_char_latex(out, source[t->start + 1]); break; @@ -528,7 +560,11 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case HASH4: case HASH5: case HASH6: - print_token(t); + for (int i = 0; i < t->len; ++i) + { + print_char('\\'); + print_char('#'); + } break; case LINE_LIST_BULLETED: case LINE_LIST_ENUMERATED: @@ -546,6 +582,24 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case MARKER_LIST_BULLET: case MARKER_LIST_ENUMERATOR: break; + case MATH_BRACKET_OPEN: + print("\\["); + break; + case MATH_BRACKET_CLOSE: + print("\\]"); + break; + case MATH_DOLLAR_SINGLE: + print("$"); + break; + case MATH_DOLLAR_DOUBLE: + print("$$"); + break; + case MATH_PAREN_OPEN: + print("\\("); + break; + case MATH_PAREN_CLOSE: + print("\\)"); + break; case NON_INDENT_SPACE: print_char(' '); break; @@ -672,12 +726,14 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat if (temp_bool) { if (temp_short < scratch->used_citations->size) { // Re-using previous citation - printf("[%s%s%d]", - temp_short, LC("see citation"), temp_char, temp_char2, temp_short); + printf("\\citation{reuse"); + + printf("}"); } else { // This is a new citation - printf("[%s%s%d]", - temp_short, temp_short, LC("see citation"), temp_char, temp_char2, temp_short); + printf("\\citation{"); + + printf("}"); } } @@ -699,12 +755,16 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat if (temp_short < scratch->used_footnotes->size) { // Re-using previous footnote - printf("[%d]", - temp_short, LC("see footnote"), temp_short); + printf("\\footnote{reuse"); + + printf("}"); } else { // This is a new footnote - printf("[%d]", - temp_short, temp_short, LC("see footnote"), temp_short); + printf("\\footnote{"); + temp_note = stack_peek_index(scratch->used_footnotes, temp_short - 1); + + mmd_export_token_latex(out, source, temp_note->content, scratch); + printf("}"); } } else { // Footnotes disabled @@ -749,6 +809,9 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat else print_localized(QUOTE_RIGHT_DOUBLE); break; + case SLASH: + print("\\slash "); + break; case STAR: print_token(t); break; @@ -758,6 +821,28 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case STRONG_STOP: print("}"); break; + case SUBSCRIPT: + if (t->mate) { + (t->start < t->mate->start) ? (print("\\textsubscript{")) : (print("}")); + } else if (t->len != 1) { + print("\\textsubscript{"); + mmd_export_token_latex(out, source, t->child, scratch); + print("}"); + } else { + print("\\ensuremath{\\sim}"); + } + break; + case SUPERSCRIPT: + if (t->mate) { + (t->start < t->mate->start) ? (print("\\textsuperscript{")) : (print("}")); + } else if (t->len != 1) { + print("\\textsuperscript{"); + mmd_export_token_latex(out, source, t->child, scratch); + print("}"); + } else { + print("\\^{}"); + } + break; case TEXT_EMPTY: break; case TEXT_NL: @@ -769,6 +854,9 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case TEXT_PLAIN: print_token(t); break; + case UL: + print_token(t); + break; default: fprintf(stderr, "Unknown token type: %d\n", t->type); token_describe(t, source); diff --git a/src/lexer.c b/src/lexer.c index 08f0e51..2dba07e 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 on Wed Feb 8 17:39:07 2017 */ +/* Generated by re2c 0.14.3 on Sun Feb 12 08:34:29 2017 */ /** MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more. @@ -84,22 +84,23 @@ int scan(Scanner * s, const char * stop) { yych = *YYCURSOR; switch (yych) { - case '\t': goto yy40; - case '\n': goto yy45; - case '\r': goto yy47; - case ' ': goto yy42; + case '\t': goto yy42; + case '\n': goto yy47; + case '\r': goto yy49; + case ' ': goto yy44; case '!': goto yy18; case '"': goto yy26; - case '#': goto yy43; - case '$': goto yy36; + case '#': goto yy45; + case '$': goto yy38; case '&': goto yy33; case '\'': goto yy28; case '(': goto yy19; case ')': goto yy21; - case '*': goto yy48; + case '*': goto yy50; case '+': goto yy4; case '-': goto yy6; case '.': goto yy30; + case '/': goto yy35; case '0': case '1': case '2': @@ -109,33 +110,33 @@ int scan(Scanner * s, const char * stop) { case '6': case '7': case '8': - case '9': goto yy44; + case '9': goto yy46; case ':': goto yy31; case '<': goto yy8; case '=': goto yy12; case '>': goto yy23; case '[': goto yy14; - case '\\': goto yy35; + case '\\': goto yy37; case ']': goto yy16; - case '^': goto yy38; - case '_': goto yy50; - case '`': goto yy52; + case '^': goto yy40; + case '_': goto yy52; + case '`': goto yy54; case '{': goto yy2; - case '|': goto yy54; + case '|': goto yy56; case '}': goto yy25; case '~': goto yy10; - default: goto yy56; + default: goto yy58; } yy2: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '+': goto yy252; - case '-': goto yy251; - case '=': goto yy248; - case '>': goto yy250; - case '{': goto yy246; - case '~': goto yy249; + case '+': goto yy256; + case '-': goto yy255; + case '=': goto yy252; + case '>': goto yy254; + case '{': goto yy250; + case '~': goto yy253; default: goto yy3; } yy3: @@ -144,7 +145,7 @@ yy4: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '+': goto yy243; + case '+': goto yy247; default: goto yy5; } yy5: @@ -152,7 +153,7 @@ yy5: yy6: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '-': goto yy237; + case '-': goto yy241; default: goto yy7; } yy7: @@ -161,7 +162,7 @@ yy8: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '<': goto yy234; + case '<': goto yy238; default: goto yy9; } yy9: @@ -170,8 +171,8 @@ yy10: yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '>': goto yy230; - case '~': goto yy229; + case '>': goto yy234; + case '~': goto yy233; default: goto yy11; } yy11: @@ -180,7 +181,7 @@ yy12: yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '=': goto yy226; + case '=': goto yy230; default: goto yy13; } yy13: @@ -188,9 +189,9 @@ yy13: yy14: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '#': goto yy222; - case '%': goto yy220; - case '^': goto yy224; + case '#': goto yy226; + case '%': goto yy224; + case '^': goto yy228; default: goto yy15; } yy15: @@ -201,7 +202,7 @@ yy16: yy18: yych = *++YYCURSOR; switch (yych) { - case '[': goto yy218; + case '[': goto yy222; default: goto yy3; } yy19: @@ -216,7 +217,7 @@ yy23: yy25: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy216; + case '}': goto yy220; default: goto yy3; } yy26: @@ -225,7 +226,7 @@ yy26: yy28: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '\'': goto yy214; + case '\'': goto yy218; default: goto yy29; } yy29: @@ -235,11 +236,11 @@ yy30: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '\t': goto yy204; - case '\n': goto yy201; - case '\r': goto yy203; - case ' ': goto yy206; - case '.': goto yy207; + case '\t': goto yy208; + case '\n': goto yy205; + case '\r': goto yy207; + case ' ': goto yy210; + case '.': goto yy211; default: goto yy3; } yy31: @@ -250,71 +251,75 @@ yy33: yych = *(YYMARKER = ++YYCURSOR); switch (yych) { case 'A': - case 'a': goto yy196; + case 'a': goto yy200; default: goto yy34; } yy34: { return AMPERSAND; } yy35: + ++YYCURSOR; + { return SLASH; } +yy37: yych = *++YYCURSOR; switch (yych) { - case '!': goto yy184; - case '"': goto yy174; - case '#': goto yy154; - case '$': goto yy152; - case '%': goto yy150; - case '&': goto yy138; - case '\'': goto yy172; - case '(': goto yy166; - case ')': goto yy164; - case '*': goto yy130; - case '+': goto yy148; - case ',': goto yy180; - case '-': goto yy146; - case '.': goto yy186; - case '/': goto yy134; - case ':': goto yy176; - case ';': goto yy178; - case '<': goto yy142; - case '=': goto yy144; - case '>': goto yy140; - case '?': goto yy182; - case '@': goto yy136; - case '[': goto yy158; - case '\\': goto yy124; - case ']': goto yy156; - case '^': goto yy132; - case '_': goto yy128; - case '`': goto yy170; - case '{': goto yy162; - case '|': goto yy126; - case '}': goto yy160; - case '~': goto yy168; + case ' ': goto yy128; + case '!': goto yy188; + case '"': goto yy178; + case '#': goto yy158; + case '$': goto yy156; + case '%': goto yy154; + case '&': goto yy142; + case '\'': goto yy176; + case '(': goto yy170; + case ')': goto yy168; + case '*': goto yy134; + case '+': goto yy152; + case ',': goto yy184; + case '-': goto yy150; + case '.': goto yy190; + case '/': goto yy138; + case ':': goto yy180; + case ';': goto yy182; + case '<': goto yy146; + case '=': goto yy148; + case '>': goto yy144; + case '?': goto yy186; + case '@': goto yy140; + case '[': goto yy162; + case '\\': goto yy126; + case ']': goto yy160; + case '^': goto yy136; + case '_': goto yy132; + case '`': goto yy174; + case '{': goto yy166; + case '|': goto yy130; + case '}': goto yy164; + case '~': goto yy172; default: goto yy3; } -yy36: +yy38: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '$': goto yy122; - default: goto yy37; + case '$': goto yy124; + default: goto yy39; } -yy37: +yy39: { return MATH_DOLLAR_SINGLE; } -yy38: +yy40: ++YYCURSOR; { return SUPERSCRIPT; } -yy40: +yy42: ++YYCURSOR; { return INDENT_TAB; } -yy42: +yy44: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy45; - case '\r': goto yy113; - case ' ': goto yy111; + case '\n': goto yy47; + case '\r': goto yy115; + case ' ': goto yy113; default: goto yy3; } -yy43: +yy45: YYCTXMARKER = YYCURSOR + 1; yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -322,16 +327,16 @@ yy43: case '\t': case '\n': case '\r': - case ' ': goto yy72; - case '#': goto yy70; + case ' ': goto yy74; + case '#': goto yy72; default: goto yy3; } -yy44: +yy46: YYCTXMARKER = YYCURSOR + 1; yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '.': goto yy61; + case '.': goto yy63; case '0': case '1': case '2': @@ -341,66 +346,66 @@ yy44: case '6': case '7': case '8': - case '9': goto yy63; + case '9': goto yy65; default: goto yy3; } -yy45: +yy47: ++YYCURSOR; -yy46: +yy48: { return TEXT_NL; } -yy47: +yy49: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy45; - default: goto yy46; + case '\n': goto yy47; + default: goto yy48; } -yy48: +yy50: ++YYCURSOR; { return STAR; } -yy50: +yy52: ++YYCURSOR; { return UL; } -yy52: +yy54: ++YYCURSOR; yych = *YYCURSOR; - goto yy60; -yy53: + goto yy62; +yy55: { return BACKTICK; } -yy54: +yy56: ++YYCURSOR; yych = *YYCURSOR; - goto yy58; -yy55: + goto yy60; +yy57: { return PIPE; } -yy56: +yy58: yych = *++YYCURSOR; goto yy3; -yy57: +yy59: ++YYCURSOR; yych = *YYCURSOR; -yy58: +yy60: switch (yych) { - case '|': goto yy57; - default: goto yy55; + case '|': goto yy59; + default: goto yy57; } -yy59: +yy61: ++YYCURSOR; yych = *YYCURSOR; -yy60: +yy62: switch (yych) { - case '`': goto yy59; - default: goto yy53; + case '`': goto yy61; + default: goto yy55; } -yy61: +yy63: yych = *++YYCURSOR; switch (yych) { case '\t': - case ' ': goto yy68; - case '\n': goto yy65; - case '\r': goto yy67; - default: goto yy62; + case ' ': goto yy70; + case '\n': goto yy67; + case '\r': goto yy69; + default: goto yy64; } -yy62: +yy64: YYCURSOR = YYMARKER; switch (yyaccept) { case 0: goto yy3; @@ -409,16 +414,16 @@ yy62: case 3: goto yy11; case 4: goto yy13; case 5: goto yy34; - case 6: goto yy119; - case 7: goto yy202; - default: goto yy247; + case 6: goto yy121; + case 7: goto yy206; + default: goto yy251; } -yy63: +yy65: YYCTXMARKER = YYCURSOR + 1; ++YYCURSOR; yych = *YYCURSOR; switch (yych) { - case '.': goto yy61; + case '.': goto yy63; case '0': case '1': case '2': @@ -428,296 +433,293 @@ yy63: case '6': case '7': case '8': - case '9': goto yy63; - default: goto yy62; + case '9': goto yy65; + default: goto yy64; } -yy65: +yy67: ++YYCURSOR; -yy66: +yy68: YYCURSOR = YYCTXMARKER; { return TEXT_NUMBER_POSS_LIST; } -yy67: +yy69: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy65; - default: goto yy66; + case '\n': goto yy67; + default: goto yy68; } -yy68: +yy70: ++YYCURSOR; yych = *YYCURSOR; switch (yych) { case '\t': - case ' ': goto yy68; - default: goto yy66; + case ' ': goto yy70; + default: goto yy68; } -yy70: +yy72: YYCTXMARKER = YYCURSOR + 1; yych = *++YYCURSOR; switch (yych) { case '\t': case '\n': case '\r': - case ' ': goto yy78; - case '#': goto yy83; - default: goto yy62; + case ' ': goto yy80; + case '#': goto yy85; + default: goto yy64; } -yy71: +yy73: ++YYCURSOR; yych = *YYCURSOR; -yy72: +yy74: switch (yych) { case '\t': - case ' ': goto yy71; - case '\n': goto yy74; - case '\r': goto yy76; - default: goto yy73; + case ' ': goto yy73; + case '\n': goto yy76; + case '\r': goto yy78; + default: goto yy75; } -yy73: +yy75: { return HASH1; } -yy74: +yy76: ++YYCURSOR; -yy75: +yy77: YYCURSOR = YYCTXMARKER; { return HASH1; } -yy76: +yy78: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy74; - default: goto yy75; + case '\n': goto yy76; + default: goto yy77; } -yy77: +yy79: ++YYCURSOR; yych = *YYCURSOR; -yy78: +yy80: switch (yych) { case '\t': - case ' ': goto yy77; - case '\n': goto yy80; - case '\r': goto yy82; - default: goto yy79; + case ' ': goto yy79; + case '\n': goto yy82; + case '\r': goto yy84; + default: goto yy81; } -yy79: +yy81: { return HASH2; } -yy80: +yy82: ++YYCURSOR; -yy81: +yy83: YYCURSOR = YYCTXMARKER; { return HASH2; } -yy82: +yy84: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy80; - default: goto yy81; + case '\n': goto yy82; + default: goto yy83; } -yy83: +yy85: YYCTXMARKER = YYCURSOR + 1; yych = *++YYCURSOR; switch (yych) { case '\t': case '\n': case '\r': - case ' ': goto yy86; - case '#': goto yy84; - default: goto yy62; + case ' ': goto yy88; + case '#': goto yy86; + default: goto yy64; } -yy84: +yy86: YYCTXMARKER = YYCURSOR + 1; yych = *++YYCURSOR; switch (yych) { case '\t': case '\n': case '\r': - case ' ': goto yy92; - case '#': goto yy97; - default: goto yy62; + case ' ': goto yy94; + case '#': goto yy99; + default: goto yy64; } -yy85: +yy87: ++YYCURSOR; yych = *YYCURSOR; -yy86: +yy88: switch (yych) { case '\t': - case ' ': goto yy85; - case '\n': goto yy88; - case '\r': goto yy90; - default: goto yy87; + case ' ': goto yy87; + case '\n': goto yy90; + case '\r': goto yy92; + default: goto yy89; } -yy87: +yy89: { return HASH3; } -yy88: +yy90: ++YYCURSOR; -yy89: +yy91: YYCURSOR = YYCTXMARKER; { return HASH3; } -yy90: +yy92: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy88; - default: goto yy89; + case '\n': goto yy90; + default: goto yy91; } -yy91: +yy93: ++YYCURSOR; yych = *YYCURSOR; -yy92: +yy94: switch (yych) { case '\t': - case ' ': goto yy91; - case '\n': goto yy94; - case '\r': goto yy96; - default: goto yy93; + case ' ': goto yy93; + case '\n': goto yy96; + case '\r': goto yy98; + default: goto yy95; } -yy93: +yy95: { return HASH4; } -yy94: +yy96: ++YYCURSOR; -yy95: +yy97: YYCURSOR = YYCTXMARKER; { return HASH4; } -yy96: +yy98: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy94; - default: goto yy95; + case '\n': goto yy96; + default: goto yy97; } -yy97: +yy99: YYCTXMARKER = YYCURSOR + 1; yych = *++YYCURSOR; switch (yych) { case '\t': case '\n': case '\r': - case ' ': goto yy100; - case '#': goto yy98; - default: goto yy62; + case ' ': goto yy102; + case '#': goto yy100; + default: goto yy64; } -yy98: +yy100: YYCTXMARKER = YYCURSOR + 1; yych = *++YYCURSOR; switch (yych) { case '\t': case '\n': case '\r': - case ' ': goto yy106; - default: goto yy62; + case ' ': goto yy108; + default: goto yy64; } -yy99: +yy101: ++YYCURSOR; yych = *YYCURSOR; -yy100: +yy102: switch (yych) { case '\t': - case ' ': goto yy99; - case '\n': goto yy102; - case '\r': goto yy104; - default: goto yy101; + case ' ': goto yy101; + case '\n': goto yy104; + case '\r': goto yy106; + default: goto yy103; } -yy101: +yy103: { return HASH5; } -yy102: +yy104: ++YYCURSOR; -yy103: +yy105: YYCURSOR = YYCTXMARKER; { return HASH5; } -yy104: +yy106: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy102; - default: goto yy103; + case '\n': goto yy104; + default: goto yy105; } -yy105: +yy107: ++YYCURSOR; yych = *YYCURSOR; -yy106: +yy108: switch (yych) { case '\t': - case ' ': goto yy105; - case '\n': goto yy108; - case '\r': goto yy110; - default: goto yy107; + case ' ': goto yy107; + case '\n': goto yy110; + case '\r': goto yy112; + default: goto yy109; } -yy107: +yy109: { return HASH6; } -yy108: +yy110: ++YYCURSOR; -yy109: +yy111: YYCURSOR = YYCTXMARKER; { return HASH6; } -yy110: +yy112: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy108; - default: goto yy109; + case '\n': goto yy110; + default: goto yy111; } -yy111: +yy113: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '\n': goto yy115; - case '\r': goto yy117; - case ' ': goto yy114; - default: goto yy112; + case '\n': goto yy117; + case '\r': goto yy119; + case ' ': goto yy116; + default: goto yy114; } -yy112: +yy114: { return NON_INDENT_SPACE; } -yy113: +yy115: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy45; - default: goto yy46; + case '\n': goto yy47; + default: goto yy48; } -yy114: +yy116: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy115; - case '\r': goto yy117; - case ' ': goto yy118; - default: goto yy112; + case '\n': goto yy117; + case '\r': goto yy119; + case ' ': goto yy120; + default: goto yy114; } -yy115: +yy117: ++YYCURSOR; -yy116: +yy118: { return TEXT_LINEBREAK; } -yy117: +yy119: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy115; - default: goto yy116; + case '\n': goto yy117; + default: goto yy118; } -yy118: +yy120: yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '\n': goto yy115; - case '\r': goto yy117; - case ' ': goto yy120; - default: goto yy119; + case '\n': goto yy117; + case '\r': goto yy119; + case ' ': goto yy122; + default: goto yy121; } -yy119: +yy121: { return INDENT_SPACE; } -yy120: +yy122: ++YYCURSOR; yych = *YYCURSOR; switch (yych) { - case '\n': goto yy115; - case '\r': goto yy117; - case ' ': goto yy120; - default: goto yy62; + case '\n': goto yy117; + case '\r': goto yy119; + case ' ': goto yy122; + default: goto yy64; } -yy122: +yy124: ++YYCURSOR; { return MATH_DOLLAR_DOUBLE; } -yy124: +yy126: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '(': goto yy188; - case ')': goto yy190; - case '[': goto yy192; - case ']': goto yy194; - default: goto yy125; + case '(': goto yy192; + case ')': goto yy194; + case '[': goto yy196; + case ']': goto yy198; + default: goto yy127; } -yy125: - { return ESCAPED_CHARACTER; } -yy126: - ++YYCURSOR; +yy127: { return ESCAPED_CHARACTER; } yy128: ++YYCURSOR; @@ -811,241 +813,247 @@ yy186: { return ESCAPED_CHARACTER; } yy188: ++YYCURSOR; - { return MATH_PAREN_OPEN; } + { return ESCAPED_CHARACTER; } yy190: ++YYCURSOR; - { return MATH_PAREN_CLOSE; } + { return ESCAPED_CHARACTER; } yy192: ++YYCURSOR; - { return MATH_BRACKET_OPEN; } + { return MATH_PAREN_OPEN; } yy194: ++YYCURSOR; - { return MATH_BRACKET_CLOSE; } + { return MATH_PAREN_CLOSE; } yy196: + ++YYCURSOR; + { return MATH_BRACKET_OPEN; } +yy198: + ++YYCURSOR; + { return MATH_BRACKET_CLOSE; } +yy200: yych = *++YYCURSOR; switch (yych) { case 'M': - case 'm': goto yy197; - default: goto yy62; + case 'm': goto yy201; + default: goto yy64; } -yy197: +yy201: yych = *++YYCURSOR; switch (yych) { case 'P': - case 'p': goto yy198; - default: goto yy62; + case 'p': goto yy202; + default: goto yy64; } -yy198: +yy202: yych = *++YYCURSOR; switch (yych) { - case ';': goto yy199; - default: goto yy62; + case ';': goto yy203; + default: goto yy64; } -yy199: +yy203: ++YYCURSOR; { return AMPERSAND_LONG; } -yy201: +yy205: ++YYCURSOR; -yy202: +yy206: YYCURSOR = YYCTXMARKER; { return TEXT_PERIOD; } -yy203: +yy207: yych = *++YYCURSOR; switch (yych) { - case '\n': goto yy201; - default: goto yy202; + case '\n': goto yy205; + default: goto yy206; } -yy204: +yy208: ++YYCURSOR; yych = *YYCURSOR; -yy205: +yy209: switch (yych) { case '\t': - case ' ': goto yy204; - default: goto yy202; + case ' ': goto yy208; + default: goto yy206; } -yy206: +yy210: yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case '.': goto yy210; - default: goto yy205; + case '.': goto yy214; + default: goto yy209; } -yy207: +yy211: yych = *++YYCURSOR; switch (yych) { - case '.': goto yy208; - default: goto yy62; + case '.': goto yy212; + default: goto yy64; } -yy208: +yy212: ++YYCURSOR; { return ELLIPSIS; } -yy210: +yy214: yych = *++YYCURSOR; switch (yych) { - case ' ': goto yy211; - default: goto yy62; + case ' ': goto yy215; + default: goto yy64; } -yy211: +yy215: yych = *++YYCURSOR; switch (yych) { - case '.': goto yy212; - default: goto yy62; + case '.': goto yy216; + default: goto yy64; } -yy212: +yy216: ++YYCURSOR; { return ELLIPSIS; } -yy214: +yy218: ++YYCURSOR; { return QUOTE_RIGHT_ALT; } -yy216: +yy220: ++YYCURSOR; { return BRACE_DOUBLE_RIGHT; } -yy218: +yy222: ++YYCURSOR; { return BRACKET_IMAGE_LEFT; } -yy220: +yy224: ++YYCURSOR; { return BRACKET_VARIABLE_LEFT; } -yy222: +yy226: ++YYCURSOR; { return BRACKET_CITATION_LEFT; } -yy224: +yy228: ++YYCURSOR; { return BRACKET_FOOTNOTE_LEFT; } -yy226: +yy230: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy227; - default: goto yy62; + case '}': goto yy231; + default: goto yy64; } -yy227: +yy231: ++YYCURSOR; { return CRITIC_HI_CLOSE; } -yy229: +yy233: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy232; - default: goto yy62; + case '}': goto yy236; + default: goto yy64; } -yy230: +yy234: ++YYCURSOR; { return CRITIC_SUB_DIV; } -yy232: +yy236: ++YYCURSOR; { return CRITIC_SUB_CLOSE; } -yy234: +yy238: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy235; - default: goto yy62; + case '}': goto yy239; + default: goto yy64; } -yy235: +yy239: ++YYCURSOR; { return CRITIC_COM_CLOSE; } -yy237: +yy241: ++YYCURSOR; switch ((yych = *YYCURSOR)) { - case '-': goto yy241; - case '}': goto yy239; - default: goto yy238; + case '-': goto yy245; + case '}': goto yy243; + default: goto yy242; } -yy238: +yy242: { return DASH_N; } -yy239: +yy243: ++YYCURSOR; { return CRITIC_DEL_CLOSE; } -yy241: +yy245: ++YYCURSOR; { return DASH_M; } -yy243: +yy247: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy244; - default: goto yy62; + case '}': goto yy248; + default: goto yy64; } -yy244: +yy248: ++YYCURSOR; { return CRITIC_ADD_CLOSE; } -yy246: +yy250: yyaccept = 8; yych = *(YYMARKER = ++YYCURSOR); switch (yych) { - case 'T': goto yy263; - default: goto yy247; + case 'T': goto yy267; + default: goto yy251; } -yy247: +yy251: { return BRACE_DOUBLE_LEFT; } -yy248: +yy252: yych = *++YYCURSOR; switch (yych) { - case '=': goto yy261; - default: goto yy62; + case '=': goto yy265; + default: goto yy64; } -yy249: +yy253: yych = *++YYCURSOR; switch (yych) { - case '~': goto yy259; - default: goto yy62; + case '~': goto yy263; + default: goto yy64; } -yy250: +yy254: yych = *++YYCURSOR; switch (yych) { - case '>': goto yy257; - default: goto yy62; + case '>': goto yy261; + default: goto yy64; } -yy251: +yy255: yych = *++YYCURSOR; switch (yych) { - case '-': goto yy255; - default: goto yy62; + case '-': goto yy259; + default: goto yy64; } -yy252: +yy256: yych = *++YYCURSOR; switch (yych) { - case '+': goto yy253; - default: goto yy62; + case '+': goto yy257; + default: goto yy64; } -yy253: +yy257: ++YYCURSOR; { return CRITIC_ADD_OPEN; } -yy255: +yy259: ++YYCURSOR; { return CRITIC_DEL_OPEN; } -yy257: +yy261: ++YYCURSOR; { return CRITIC_COM_OPEN; } -yy259: +yy263: ++YYCURSOR; { return CRITIC_SUB_OPEN; } -yy261: +yy265: ++YYCURSOR; { return CRITIC_HI_OPEN; } -yy263: +yy267: yych = *++YYCURSOR; switch (yych) { - case 'O': goto yy264; - default: goto yy62; + case 'O': goto yy268; + default: goto yy64; } -yy264: +yy268: yych = *++YYCURSOR; switch (yych) { - case 'C': goto yy265; - default: goto yy62; + case 'C': goto yy269; + default: goto yy64; } -yy265: +yy269: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy266; - default: goto yy62; + case '}': goto yy270; + default: goto yy64; } -yy266: +yy270: yych = *++YYCURSOR; switch (yych) { - case '}': goto yy267; - default: goto yy62; + case '}': goto yy271; + default: goto yy64; } -yy267: +yy271: ++YYCURSOR; { return TOC; } } diff --git a/src/lexer.re b/src/lexer.re index 77bed4e..6755d08 100644 --- a/src/lexer.re +++ b/src/lexer.re @@ -140,6 +140,8 @@ int scan(Scanner * s, const char * stop) { '&' { return AMPERSAND_LONG; } "&" { return AMPERSAND; } + "/" { return SLASH; } + "\\." { return ESCAPED_CHARACTER; } "\\!" { return ESCAPED_CHARACTER; } "\\?" { return ESCAPED_CHARACTER; } @@ -180,6 +182,8 @@ int scan(Scanner * s, const char * stop) { "\\|" { return ESCAPED_CHARACTER; } + "\\ " { return ESCAPED_CHARACTER; } + "\\\\(" { return MATH_PAREN_OPEN; } "\\\\)" { return MATH_PAREN_CLOSE; } "\\\\[" { return MATH_BRACKET_OPEN; } diff --git a/src/libMultiMarkdown.h b/src/libMultiMarkdown.h index 6686084..28fa018 100644 --- a/src/libMultiMarkdown.h +++ b/src/libMultiMarkdown.h @@ -242,6 +242,7 @@ enum token_types { EQUAL, PIPE, PLUS, + SLASH, SUPERSCRIPT, SUBSCRIPT, diff --git a/src/parser.c b/src/parser.c index 2c09820..a448304 100644 --- a/src/parser.c +++ b/src/parser.c @@ -753,7 +753,7 @@ static unsigned int yy_find_shift_action( yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } #endif - assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ + // assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ iLookAhead = iFallback; continue; } diff --git a/src/writer.c b/src/writer.c index 489f062..276e957 100644 --- a/src/writer.c +++ b/src/writer.c @@ -675,6 +675,7 @@ char * destination_accept(const char * source, token ** remainder, bool validate t = token_chain_accept_multiple(remainder, 2, PAIR_ANGLE, PAIR_PAREN); url = text_inside_pair(source, t); break; + case SLASH: case TEXT_PLAIN: start = (*remainder)->start; @@ -736,11 +737,12 @@ char * url_accept(const char * source, token ** remainder, bool validate) { t = token_chain_accept_multiple(remainder, 2, PAIR_ANGLE, PAIR_PAREN); url = text_inside_pair(source, t); break; + case SLASH: case TEXT_PLAIN: first = *remainder; // Grab parts for URL - while (token_chain_accept_multiple(remainder, 6, AMPERSAND, COLON, EQUAL, TEXT_PERIOD, TEXT_PLAIN, UL)); + while (token_chain_accept_multiple(remainder, 7, AMPERSAND, COLON, EQUAL, SLASH, TEXT_PERIOD, TEXT_PLAIN, UL)); last = (*remainder)->prev; diff --git a/tests/MMD6Tests/Blockquotes.tex b/tests/MMD6Tests/Blockquotes.tex index d958092..5ae3679 100644 --- a/tests/MMD6Tests/Blockquotes.tex +++ b/tests/MMD6Tests/Blockquotes.tex @@ -1,33 +1,36 @@ \begin{quote} - foo - bar +bar +\end{quote} +\begin{quote} foo \begin{quote} - bar foo \end{quote} +\end{quote} +\begin{quote} foo \begin{quote} - bar \end{quote} foo +\end{quote} +\begin{quote} foo - bar +bar foo \begin{verbatim} - bar + bar +foo \end{verbatim} -foo bar \end{quote} diff --git a/tests/MMD6Tests/Dutch.tex b/tests/MMD6Tests/Dutch.tex index 37d3679..ebc1b93 100644 --- a/tests/MMD6Tests/Dutch.tex +++ b/tests/MMD6Tests/Dutch.tex @@ -1,5 +1,3 @@ -\def\language{nl} - `foo' ``foo'' diff --git a/tests/MMD6Tests/Escapes.html b/tests/MMD6Tests/Escapes.html index 32a8f31..33cb1a9 100644 --- a/tests/MMD6Tests/Escapes.html +++ b/tests/MMD6Tests/Escapes.html @@ -90,3 +90,5 @@

_bar_

`foo`

+ +

foo bar

diff --git a/tests/MMD6Tests/Escapes.htmlc b/tests/MMD6Tests/Escapes.htmlc index 32a8f31..1c1b520 100644 --- a/tests/MMD6Tests/Escapes.htmlc +++ b/tests/MMD6Tests/Escapes.htmlc @@ -90,3 +90,5 @@

_bar_

`foo`

+ +

foo bar

diff --git a/tests/MMD6Tests/Escapes.tex b/tests/MMD6Tests/Escapes.tex new file mode 100644 index 0000000..69d9e89 --- /dev/null +++ b/tests/MMD6Tests/Escapes.tex @@ -0,0 +1,95 @@ +. + +! + +? + +, + +; + +5 + +: + +" + +' + +` + +\ensuremath{\sim} + +10 + +( + +) + +\{ + +\} + +[ + +15 + +] + +\# + +\$ + +\% + ++ + +20 + +- + += + +$<$ + +$>$ + +\& + +25 + +@ + + + +\slash + +\^{} + +* + +30 + +\_ + +\textbar{} + +\begin{verbatim} +\- +\& +\% +\\ +\` +\end{verbatim} + +`- \textbackslash{}\& \textbackslash{}\% \textbackslash{} `` + +*foo* + +35 + +\_bar\_ + +`foo` + +foo~bar diff --git a/tests/MMD6Tests/Escapes.text b/tests/MMD6Tests/Escapes.text index 7c7c18f..a1b52c3 100644 --- a/tests/MMD6Tests/Escapes.text +++ b/tests/MMD6Tests/Escapes.text @@ -89,3 +89,5 @@ \_bar\_ \`foo\` + +foo\ bar diff --git a/tests/MMD6Tests/French.tex b/tests/MMD6Tests/French.tex index 14b9036..ebc1b93 100644 --- a/tests/MMD6Tests/French.tex +++ b/tests/MMD6Tests/French.tex @@ -1,5 +1,3 @@ -\def\language{fr} - `foo' ``foo'' diff --git a/tests/MMD6Tests/German Guillemets.tex b/tests/MMD6Tests/German Guillemets.tex index 4b08470..1f4ffef 100644 --- a/tests/MMD6Tests/German Guillemets.tex +++ b/tests/MMD6Tests/German Guillemets.tex @@ -1,5 +1,3 @@ -\def\language{de} - ›foo‹ »foo« diff --git a/tests/MMD6Tests/German.tex b/tests/MMD6Tests/German.tex index 5ba80e7..ebc1b93 100644 --- a/tests/MMD6Tests/German.tex +++ b/tests/MMD6Tests/German.tex @@ -1,5 +1,3 @@ -\def\language{de} - `foo' ``foo'' diff --git a/tests/MMD6Tests/Headers.tex b/tests/MMD6Tests/Headers.tex new file mode 100644 index 0000000..d665b97 --- /dev/null +++ b/tests/MMD6Tests/Headers.tex @@ -0,0 +1,47 @@ +\part{foo } +\label{foo} + +\part{foo } +\label{foo} + +\part{foo } +\label{foo} + +\part{foo } +\label{foo} + +\begin{verbatim} +# foo # +\end{verbatim} + +5 + +#foo# + +#foo # + +\part{foo \# bar} +\label{foobar} + +\# foo \# + +\chapter{foo } +\label{foo} + +10 + +\section{foo } +\label{foo} + +\subsection{foo } +\label{foo} + +\subsubsection{foo } +\label{foo} + +\paragraph{foo } +\label{foo} + +\#\#\#\#\#\#\# foo \#\#\#\#\#\#\# + +15 diff --git a/tests/MMD6Tests/Indented Code Blocks.tex b/tests/MMD6Tests/Indented Code Blocks.tex new file mode 100644 index 0000000..90e6964 --- /dev/null +++ b/tests/MMD6Tests/Indented Code Blocks.tex @@ -0,0 +1,66 @@ +\begin{verbatim} +foo +\end{verbatim} + +foo + +\begin{verbatim} +bar +\end{verbatim} + +foo + + foo + +5 + +foo + +foo + +\begin{verbatim} +bar +\end{verbatim} + +foo + +\begin{verbatim} + bar +\end{verbatim} + +10 + +foo + +\begin{verbatim} +bar + bar +\end{verbatim} + +foo + +\begin{verbatim} +bar +\end{verbatim} + +15 + +foo +bar +bar + +foo + +\begin{verbatim} +bar +\end{verbatim} + +foo + +\begin{verbatim} +bar + +bar + +bar +\end{verbatim} diff --git a/tests/MMD6Tests/Integrated.html b/tests/MMD6Tests/Integrated.html new file mode 100644 index 0000000..eb9eed0 --- /dev/null +++ b/tests/MMD6Tests/Integrated.html @@ -0,0 +1,66 @@ +

This file is a designed as a single test that incorporates most of the +commonly used MultiMarkdown features. This allows a single test file to +identify common structures that are not supported yet – particularly useful +when developing a new output format.

+ +

Basic Blocks

+ +

paragraph

+ + + +
fenced
+code
+
+ +
indented
+code
+
+ +
+

blockquote

+
+ +

code span

+ +

emph and strong and both

+ +

emph and strong and both

+ +

Escapes

+ +
    +
  1. $

  2. +
  3. #

  4. +
  5. [

  6. +
+ +

Foo.[1]

+ +

Bar.[2]

+ +

link and link

+ +

math \({e}^{i\pi }+1=0\)

+ +

Smart Quotes

+ +

“foo” and ‘bar’ – with — dashes…

+ +
+
+
    + +
  1. +

    This is an inline footnote  ↩

    +
  2. + +
  3. +

    And a reference footnote.  ↩

    +
  4. + +
+
diff --git a/tests/MMD6Tests/Integrated.htmlc b/tests/MMD6Tests/Integrated.htmlc new file mode 100644 index 0000000..ac16124 --- /dev/null +++ b/tests/MMD6Tests/Integrated.htmlc @@ -0,0 +1,54 @@ +

This file is a designed as a single test that incorporates most of the +commonly used MultiMarkdown features. This allows a single test file to +identify common structures that are not supported yet -- particularly useful +when developing a new output format.

+ +

Basic Blocks

+ +

paragraph

+ + + +

fenced +code

+ +
indented
+code
+
+ +
+

blockquote

+
+ +

code span

+ +

emph and strong and both

+ +

emph and strong and both

+ +

Escapes [escaped]

+ +
    +
  1. $

  2. +
  3. #

  4. +
  5. [

  6. +
+ +

Foo.[^This is an inline footnote]

+ +

Bar.[^foot]

+ +

[^foot]: And a reference footnote.

+ +

link and [link]

+ +

[link]: http://bar.net "title" class="custom"

+ +

math ${e}^{i\pi }+1=0$

+ +

Smart Quotes

+ +

"foo" and 'bar' -- with --- dashes...

diff --git a/tests/MMD6Tests/Integrated.tex b/tests/MMD6Tests/Integrated.tex new file mode 100644 index 0000000..eeb5dd3 --- /dev/null +++ b/tests/MMD6Tests/Integrated.tex @@ -0,0 +1,61 @@ +This file is a designed as a single test that incorporates most of the +\emph{commonly} used MultiMarkdown features. This allows a single test file to +identify common structures that are not supported yet -- particularly useful +when developing a new output format. + +\part{Basic Blocks } +\label{basicblocks} + +paragraph + +\begin{itemize} +\item list + +\item items + +\end{itemize} + +\begin{verbatim} +fenced +code +\end{verbatim} + +\begin{verbatim} +indented +code +\end{verbatim} + +\begin{quote} +blockquote +\end{quote} + +\texttt{code span} + +\emph{emph} and \textbf{strong} and \textbf{\emph{both}} + +\emph{emph} and \textbf{strong} and \textbf{\emph{both}} + +\chapter{Escapes } +\label{escaped} + +\begin{enumerate} +\item \$ + +\item \# + +\item [ + +\end{enumerate} + +Foo.\footnote{This is an inline footnote} + +Bar.\footnote{And a reference footnote.} + +\href{http://foo.net/}{link}\footnote{\href{http://foo.net/}{http:/\slash foo.net\slash }} and \href{http://bar.net}{link}\footnote{\href{http://bar.net}{http:/\slash bar.net}} + +math ${e}^{i\pi }+1=0$ + +\part{Smart Quotes } +\label{smartquotes} + +``foo'' and `bar' -- with --- dashes{\ldots} diff --git a/tests/MMD6Tests/Integrated.text b/tests/MMD6Tests/Integrated.text new file mode 100644 index 0000000..1da8522 --- /dev/null +++ b/tests/MMD6Tests/Integrated.text @@ -0,0 +1,56 @@ +This file is a designed as a single test that incorporates most of the +*commonly* used MultiMarkdown features. This allows a single test file to +identify common structures that are not supported yet -- particularly useful +when developing a new output format. + +# Basic Blocks # + +paragraph + +* list +* items + +``` +fenced +code +``` + + indented + code + +> blockquote + +`code span` + + +*emph* and **strong** and ***both*** + +_emph_ and __strong__ and ___both___ + + +Escapes [escaped] +---------------- + +1. \$ + +2. \# + +3. \[ + +Foo.[^This is an inline footnote] + +Bar.[^foot] + +[^foot]: And a reference footnote. + +[link](http://foo.net/) and [link] + +[link]: http://bar.net "title" class="custom" + +math ${e}^{i\pi }+1=0$ + +# Smart Quotes # + +"foo" and 'bar' -- with --- dashes... + + diff --git a/tests/MMD6Tests/Math.tex b/tests/MMD6Tests/Math.tex new file mode 100644 index 0000000..b1d1a3b --- /dev/null +++ b/tests/MMD6Tests/Math.tex @@ -0,0 +1,51 @@ +foo ${e}^{i\pi }+1=0$ bar + +\[ {x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a} \] + +foo ${e}^{i\pi }+1=0$ bar + +foo ${e}^{i\pi }+1=0$, bar + +$${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$ + +5 + +foo \$ \{e\}\textsuperscript{{i}\textbackslash{}pi \}+1=0\$ bar + +\$\$ \{x\}\_\{1,2\}=\textbackslash{}frac\{-b\textbackslash{}pm \textbackslash{}sqrt\{\{b\}\textsuperscript{{2}}--4ac\}\}\{2a\}\$\$ + +foo \$\{e\}\textsuperscript{{i}\textbackslash{}pi \}+1=0 \$ bar + +\$\$\{x\}\_\{1,2\}=\textbackslash{}frac\{-b\textbackslash{}pm \textbackslash{}sqrt\{\{b\}\textsuperscript{{2}}--4ac\}\}\{2a\} \$\$ + +foo a\$\{e\}\textsuperscript{{i}\textbackslash{}pi \}+1=0\$ bar + +10 + +a\$\$\{x\}\_\{1,2\}=\textbackslash{}frac\{-b\textbackslash{}pm \textbackslash{}sqrt\{\{b\}\textsuperscript{{2}}--4ac\}\}\{2a\}\$\$ + +foo \$\{e\}\textsuperscript{{i}\textbackslash{}pi \}+1=0\$b bar + +\$\$\{x\}\_\{1,2\}=\textbackslash{}frac\{-b\textbackslash{}pm \textbackslash{}sqrt\{\{b\}\textsuperscript{{2}}--4ac\}\}\{2a\}\$\$b + +$\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}$ + +$$\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}$$ + +15 + +$\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}$ + +\[\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\] + +\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation} + +$\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation} + +\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation} + +20 + +\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation} + +\texttt{\textbackslash{}begin\{equation\}\textbackslash{}nabla \textbackslash{}times \textbackslash{}mathbf\{E\} = - \textbackslash{}frac\{\textbackslash{}partial \textbackslash{}mathbf\{B\}\}\{\textbackslash{}partial t\}\textbackslash{}end\{equation\}} diff --git a/tests/MMD6Tests/Nested Lists.tex b/tests/MMD6Tests/Nested Lists.tex new file mode 100644 index 0000000..e1b0db6 --- /dev/null +++ b/tests/MMD6Tests/Nested Lists.tex @@ -0,0 +1,129 @@ +\begin{itemize} +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\end{itemize} + +bar + +\begin{itemize} +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\end{itemize} + +bar + +\begin{itemize} +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\end{itemize} + +5 + +\begin{itemize} +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\end{itemize} + +bar + +\begin{itemize} +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\item foo + +\begin{itemize} +\item bar + +\end{itemize} + +\end{itemize} + +bar diff --git a/tests/MMD6Tests/Superscript.tex b/tests/MMD6Tests/Superscript.tex new file mode 100644 index 0000000..6e99b6a --- /dev/null +++ b/tests/MMD6Tests/Superscript.tex @@ -0,0 +1,27 @@ +x\textsuperscript{2}. + +x\textsuperscript{2xz}. + +x\textsuperscript{2.} + +x\textsuperscript{2} 3\^{} + +x\textsuperscript{2} 3\textsuperscript{2} + +5 + +x\textsubscript{z}. + +x\textsubscript{xyz}. + +z\textsubscript{z.} + +\ensuremath{\sim}\slash Library\slash MultiMarkdown + +\^{}test + +10 + +x\^{}y + +x\ensuremath{\sim}y diff --git a/tests/MMD6Tests/Swedish.tex b/tests/MMD6Tests/Swedish.tex index 096f20d..ebc1b93 100644 --- a/tests/MMD6Tests/Swedish.tex +++ b/tests/MMD6Tests/Swedish.tex @@ -1,5 +1,3 @@ -\def\language{sv} - `foo' ``foo''