From a05ac160f20d92d17c41ca2fddd3123111919fab Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Wed, 15 Mar 2017 11:35:30 -0400 Subject: [PATCH] FIXED: Fix printing raw CriticMarkup tokens in LaTeX --- Sources/libMultiMarkdown/latex.c | 58 ++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/Sources/libMultiMarkdown/latex.c b/Sources/libMultiMarkdown/latex.c index 85bfba0..ae05e4a 100644 --- a/Sources/libMultiMarkdown/latex.c +++ b/Sources/libMultiMarkdown/latex.c @@ -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("""); + 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("-"); -- 2.40.0