case PAIR_HTML_COMMENT:
print_token(t);
break;
- case PAIR_EMPH:
case PAIR_MATH:
+ print_const("<span class=\"math\">");
+ mmd_export_token_tree_html_raw(out, source, t->child, scratch);
+ print_const("</span>");
+ break;
+ case PAIR_EMPH:
case PAIR_PAREN:
case PAIR_QUOTE_DOUBLE:
case PAIR_QUOTE_SINGLE:
print_const("\\");
mmd_print_char_html(out, source[t->start + 1], false);
break;
+ case MATH_BRACKET_OPEN:
+ print_const("\\[");
+ break;
+ case MATH_BRACKET_CLOSE:
+ print_const("\\]");
+ break;
+ case MATH_DOLLAR_SINGLE:
+ if (t->mate) {
+ (t->start < t->mate->start) ? ( print_const("\\(") ) : ( print_const("\\)") );
+ } else {
+ print_const("$");
+ }
+ break;
+ case MATH_DOLLAR_DOUBLE:
+ if (t->mate) {
+ (t->start < t->mate->start) ? ( print_const("\\[") ) : ( print_const("\\]") );
+ } else {
+ print_const("$$");
+ }
+ break;
+ case MATH_PAREN_OPEN:
+ print_const("\\(");
+ break;
+ case MATH_PAREN_CLOSE:
+ print_const("\\)");
+ break;
case QUOTE_DOUBLE:
print_const(""");
break;
}
- if (t->child != NULL)
- pair_emphasis_tokens(t->child);
+ if (t->child != NULL) {
+ switch(t->type) {
+ case PAIR_BACKTICK:
+ case PAIR_MATH:
+ break;
+ default:
+ pair_emphasis_tokens(t->child);
+ break;
+ }
+ }
t = t->next;
}
<text:p text:style-name="Standard"><text:span text:style-name="math">\[\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}\]</text:span></text:p>
<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">\(a *foo* b\)</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">\[a *foo* b\]</text:span></text:p>
</office:text>
</office:body>
</office:document>
<p><code>\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}</code></p>
+<p><span class="math">\(a *foo* b\)</span></p>
+
+<p><span class="math">\[a *foo* b\]</span></p>
+
</body>
</html>
<p>\[\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}\]</p>
<p><code>\begin{equation}\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}\end{equation}</code></p>
+
+<p>$a <em>foo</em> b$</p>
+
+<p>\[a <em>foo</em> b\]</p>
\texttt{\textbackslash{}begin\{equation\}\textbackslash{}nabla \textbackslash{}times \textbackslash{}mathbf\{E\} = - \textbackslash{}frac\{\textbackslash{}partial \textbackslash{}mathbf\{B\}\}\{\textbackslash{}partial t\}\textbackslash{}end\{equation\}}
+$a *foo* b$
+
+\[a *foo* b\]
+
\input{mmd6-article-footer}
\end{document}
\\[\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}`
+
+$a *foo* b$
+
+\\[a *foo* b\\]