]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix printing raw CriticMarkup tokens in LaTeX
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 15 Mar 2017 15:35:30 +0000 (11:35 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 15 Mar 2017 15:35:30 +0000 (11:35 -0400)
Sources/libMultiMarkdown/latex.c

index 85bfba09d14bbe09833d8f068037379eec9a1910..ae05e4a611772fc52813ce051d8676a7d9ef2502 100644 (file)
@@ -788,37 +788,37 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        print_const(":");
                        break;
                case CRITIC_ADD_OPEN:
-                       print_const("{++");
+                       print_const("\\{++");
                        break;
                case CRITIC_ADD_CLOSE:
-                       print_const("++}");
+                       print_const("++\\}");
                        break;
                case CRITIC_COM_OPEN:
-                       print_const("{>>");
+                       print_const("\\{>>");
                        break;
                case CRITIC_COM_CLOSE:
-                       print_const("<<}");
+                       print_const("<<\\}");
                        break;
                case CRITIC_DEL_OPEN:
-                       print_const("{--");
+                       print_const("\\{--");
                        break;
                case CRITIC_DEL_CLOSE:
-                       print_const("--}");
+                       print_const("--\\}");
                        break;
                case CRITIC_HI_OPEN:
-                       print_const("{==");
+                       print_const("\\{==");
                        break;
                case CRITIC_HI_CLOSE:
-                       print_const("==}");
+                       print_const("==\\}");
                        break;
                case CRITIC_SUB_OPEN:
-                       print_const("{~~");
+                       print_const("\\{~~");
                        break;
                case CRITIC_SUB_DIV:
                        print_const("~>");
                        break;
                case CRITIC_SUB_CLOSE:
-                       print_const("~~}");
+                       print_const("~~\\}");
                        break;
                case DASH_M:
                        if (!(scratch->extensions & EXT_SMART)) {
@@ -1454,7 +1454,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        break;
                case QUOTE_DOUBLE:
                        if ((t->mate == NULL) || (!(scratch->extensions & EXT_SMART)))
-                               print_const("&quot;");
+                               print_const("''");
                        else
                                (t->start < t->mate->start) ? ( print_localized(QUOTE_LEFT_DOUBLE) ) : ( print_localized(QUOTE_RIGHT_DOUBLE) );
                        break;
@@ -1572,6 +1572,9 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                case TEXT_PLAIN:
                        print_token(t);
                        break;
+               case TOC:
+                       print_const("\\{\\{TOC\\}\\}");
+                       break;
                case UL:
                        print_const("\\_");
                        break;
@@ -1659,6 +1662,39 @@ void mmd_export_token_latex_tt(DString * out, const char * source, token * t, sc
                case ANGLE_RIGHT:
                        print_const("$>$");
                        break;
+               case CRITIC_ADD_OPEN:
+                       print_const("\\{++");
+                       break;
+               case CRITIC_ADD_CLOSE:
+                       print_const("++\\}");
+                       break;
+               case CRITIC_COM_OPEN:
+                       print_const("\\{>>");
+                       break;
+               case CRITIC_COM_CLOSE:
+                       print_const("<<\\}");
+                       break;
+               case CRITIC_DEL_OPEN:
+                       print_const("\\{--");
+                       break;
+               case CRITIC_DEL_CLOSE:
+                       print_const("--\\}");
+                       break;
+               case CRITIC_HI_OPEN:
+                       print_const("\\{==");
+                       break;
+               case CRITIC_HI_CLOSE:
+                       print_const("==\\}");
+                       break;
+               case CRITIC_SUB_OPEN:
+                       print_const("\\{~~");
+                       break;
+               case CRITIC_SUB_DIV:
+                       print_const("~>");
+                       break;
+               case CRITIC_SUB_CLOSE:
+                       print_const("~~\\}");
+                       break;
                case DASH_N:
                        if (t->len == 1) {
                                print_const("-");