render mathjax in svg by default (TNL-4145)
mathjax preview should be inline by default
This commit is contained in:
@@ -139,7 +139,7 @@ describe("Formula Equation Preview", function () {
|
||||
// Either it makes a request or jumps straight into displaying ''.
|
||||
waitsFor(function () {
|
||||
// (Short circuit if `inputAjax` is indeed called)
|
||||
return Problem.inputAjax.wasCalled ||
|
||||
return Problem.inputAjax.wasCalled || // jshint ignore:line
|
||||
MathJax.Hub.Queue.wasCalled;
|
||||
}, "AJAX never called on user input", 1000);
|
||||
|
||||
@@ -266,7 +266,7 @@ describe("Formula Equation Preview", function () {
|
||||
|
||||
// We should look in the preview div for the MathJax.
|
||||
var previewElement = $("#input_THE_ID_preview")[0];
|
||||
expect(previewElement.firstChild.data).toEqual("\\[THE_FORMULA\\]");
|
||||
expect(previewElement.firstChild.data).toEqual("\\(THE_FORMULA\\)");
|
||||
|
||||
// Refresh the MathJax.
|
||||
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
|
||||
|
||||
@@ -145,7 +145,7 @@ formulaEquationPreview.enable = function () {
|
||||
console.log("[FormulaEquationInput] Oops no mathjax for ", latex);
|
||||
// Fall back to modifying the actual element.
|
||||
var textNode = previewElement.childNodes[0];
|
||||
textNode.data = "\\[" + latex + "\\]";
|
||||
textNode.data = "\\(" + latex + "\\)";
|
||||
MathJax.Hub.Queue(["Typeset", MathJax.Hub, previewElement]);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user