]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix underscores in raw latex
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 4 Mar 2017 19:16:18 +0000 (14:16 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 4 Mar 2017 19:16:18 +0000 (14:16 -0500)
Sources/libMultiMarkdown/latex.c
tests/MMD6Tests/Emph and Strong UL.tex
tests/MMD6Tests/Fenced Code Blocks.html
tests/MMD6Tests/Fenced Code Blocks.htmlc
tests/MMD6Tests/Fenced Code Blocks.tex
tests/MMD6Tests/Fenced Code Blocks.text

index 5d6bdac6b5946586cabd199ee0386525c72235af..32996f9cfc2362792debd0a5dbdd235d1fe60dee 100644 (file)
@@ -1540,6 +1540,14 @@ void mmd_export_token_latex_tt(DString * out, const char * source, token * t, sc
                case DASH_M:
                        print_const("-{}-{}-");
                        break;
+               case EMPH_START:
+               case EMPH_STOP:
+                       if (source[t->start] == '_') {
+                               print_const("\\_");
+                       } else {
+                               print_const("*");
+                       }
+                       break;
                case ESCAPED_CHARACTER:
                        print_const("\\textbackslash{}");
                        mmd_print_char_latex(out, source[t->start + 1]);
index b530a24fdbc782dde3e6103763e86efc976dd126..09409649973dbca12af6b5a85bf82e1b0f9f6b4d 100644 (file)
@@ -86,7 +86,7 @@ foo\_bar\_foo
 
 35
 
-foo\_\_\texttt{_bar_}\_\_
+foo\_\_\texttt{\_bar\_}\_\_
 
 \_(\emph{foo})
 
index 68429e41049d1963ee8a9036d3be460598b21e46..e950abed80dbdc005133b72410579c0414d8c7ad 100644 (file)
@@ -30,7 +30,7 @@ bar
 <pre><code>\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
 </code></pre>
 
-<pre><code class="latex">\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
+<pre><code class="tex">\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
 </code></pre>
 
 <p>5</p>
index cdc210f782b0eb8eac3be649f9cd00538bb177a8..80da4af8c6c1ed951279dd15452e0d2ec639a5ed 100644 (file)
@@ -24,7 +24,7 @@ latex config: article</p>
 
 <p><code>\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}</code></p>
 
-<p><code>latex
+<p><code>tex
 \begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}</code></p>
 
 <p>5</p>
index d6f9222bcaaed640c67d1d329a8effd7fd016bb1..d439f955d480c498c935d78abfe1082b51e275a6 100644 (file)
@@ -33,7 +33,7 @@ bar
 \begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
 \end{verbatim}
 
-\begin{lstlisting}[language=latex]
+\begin{lstlisting}[language=tex]
 \begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
 \end{lstlisting}
 
index b58498066fbf19f6b693ebd79ed393065905d361..1a3651d71bebaf6dbafe34eacefbaf6475b8c358 100644 (file)
@@ -29,7 +29,7 @@ bar
 \begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
 ```
 
-```latex
+```tex
 \begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}
 ```