]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix issue printing '-'
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 12 Feb 2017 23:28:14 +0000 (18:28 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sun, 12 Feb 2017 23:28:14 +0000 (18:28 -0500)
src/latex.c

index ce46ba0e78a8f3c8e16cf07d7c1b0b3c85e52875..67c9b94fcc9eeef415688eac7ed7a2a3353027e0 100644 (file)
@@ -998,6 +998,11 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        }
                        break;
                case PAIR_MATH:
+                       // Math is raw LaTeX -- use string itself
+                       mmd_export_token_latex(out, source, t->child, scratch);
+                       d_string_append_c_array(out, &(source[t->child->start + t->child->len]), t->child->mate->start - t->child->start - t->child->len);
+                       mmd_export_token_latex(out, source, t->child->mate, scratch);
+                       break;                  
                case PAIR_PAREN:
                case PAIR_QUOTE_DOUBLE:
                case PAIR_QUOTE_SINGLE:
@@ -1135,7 +1140,11 @@ void mmd_export_token_latex_raw(DString * out, const char * source, token * t, s
                        print("$>$");
                        break;
                case DASH_N:
-                       print("-{}-");
+                       if (t->len == 1) {
+                               print("-");
+                       } else {
+                               print("-{}-");
+                       }
                        break;
                case DASH_M:
                        print("-{}-{}-");