Skip to content

Commit

Permalink
don't require extra \ escape for mathjax equations
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jun 21, 2012
1 parent 6f47b62 commit aaec298
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/cpp/core/markdown/MathJax.cpp
Expand Up @@ -143,7 +143,7 @@ MathJaxFilter::MathJaxFilter(const std::vector<ExcludePattern>& excludePatterns,
if (range.process)
{
// native mathjax display equations
filter(boost::regex("\\\\\\\\\\[([\\s\\S]+?)\\\\\\\\\\]"),
filter(boost::regex("\\\\\\[([\\s\\S]+?)\\\\\\]"),
&rangeText,
&displayMathBlocks_);

Expand All @@ -154,7 +154,7 @@ MathJaxFilter::MathJaxFilter(const std::vector<ExcludePattern>& excludePatterns,
&displayMathBlocks_);

// native mathjax inline equations
filter(boost::regex("\\\\\\\\\\(([\\s\\S]+?)\\\\\\\\\\)"),
filter(boost::regex("\\\\\\(([\\s\\S]+?)\\\\\\)"),
&rangeText,
&inlineMathBlocks_);

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/session/resources/markdown_help.html
Expand Up @@ -144,15 +144,15 @@ <h5>Inline Equation</h5>

$latex <i>equation</i>$

\\( <i>equation</i> \\)
\( <i>equation</i> \)
</code></pre>

<h5>Display Equation</h5>
<pre><code>$$ <i>equation</i> $$

$$latex <i>equation</i> $$

\\[ <i>equation</i> \\]
\[ <i>equation</i> \]
</code></pre>

<h4>Horizontal Rule / Page Break</h4>
Expand Down
12 changes: 6 additions & 6 deletions src/gwt/acesupport/acemode/markdown_highlight_rules.js
Expand Up @@ -78,13 +78,13 @@ var MarkdownHighlightRules = function() {
}, { // HR _
token : "constant",
regex : "^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"
}, { // MathJax native display \\[ ... \\]
}, { // MathJax native display \[ ... \]
token : "markup.list",
regex : "\\\\\\\\\\[",
regex : "\\\\\\[",
next : "mathjaxnativedisplay"
}, { // MathJax native inline \\( ... \\)
}, { // MathJax native inline \( ... \)
token : "markup.list",
regex : "\\\\\\\\\\(",
regex : "\\\\\\(",
next : "mathjaxnativeinline"
}, { // $ escape
token : "text",
Expand Down Expand Up @@ -163,7 +163,7 @@ var MarkdownHighlightRules = function() {

"mathjaxnativedisplay" : [ {
token : "markup.list",
regex : "\\\\\\\\\\]",
regex : "\\\\\\]",
next : "start"
}, {
token : "support.function",
Expand All @@ -181,7 +181,7 @@ var MarkdownHighlightRules = function() {

"mathjaxnativeinline" : [ {
token : "markup.list",
regex : "\\\\\\\\\\)",
regex : "\\\\\\)",
next : "start"
}, {
token : "support.function",
Expand Down

0 comments on commit aaec298

Please sign in to comment.