Skip to content

Commit

Permalink
use 'color' extension for MathJax
Browse files Browse the repository at this point in the history
fixes CORE-595

test-plan:
 - go to a RCE instance (e.g. creating a course page)
 - click the equation editor toolbar icon
 - switch to advanced view
 - enter "\color{Red} Hello"
 - preview below should have the word "Hello" _all_ in red text, not
   just the H

Change-Id: Id15620e40bdf4e502e202ffc8943f6c094adeeba
Reviewed-on: https://gerrit.instructure.com/132288
Tested-by: Jenkins
Reviewed-by: brian kirkby <[email protected]>
Product-Review: brian kirkby <[email protected]>
QA-Review: Tucker McKnight <[email protected]>
  • Loading branch information
lukfugl committed Nov 9, 2017
1 parent 0dcc7aa commit 655a0b6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions public/javascripts/mathml.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@

import $ from 'jquery'

// configure MathJax to use 'color' extension fo LaTeX coding
const localConfig = {
TeX: {
extensions: ["color.js"]
}
};

export function loadMathJax (config_file, cb = null) {
if (!isMathJaxLoaded() && shouldLoadMathJax()) {
// signal local config to mathjax as it loads
window.MathJax = localConfig;
$.getScript(`//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=${config_file}`, cb);
}
}
Expand Down

0 comments on commit 655a0b6

Please sign in to comment.