Commit 5830516d authored by Robert Knight's avatar Robert Knight

Fix KaTeX import

Per the release notes in https://github.com/hypothesis/client/pull/3887,
KaTeX should be imported using a default import rather than namespace
import.
parent 0fe5748b
import createDOMPurify from 'dompurify';
import escapeHtml from 'escape-html';
import * as katex from 'katex';
import katex from 'katex';
import showdown from 'showdown';
const DOMPurify = createDOMPurify(window);
......
......@@ -7,12 +7,14 @@ describe('render-markdown', () => {
beforeEach(() => {
$imports.$mock({
katex: {
renderToString: function (input, opts) {
if (opts && opts.displayMode) {
return 'math+display:' + input;
} else {
return 'math:' + input;
}
default: {
renderToString: function (input, opts) {
if (opts && opts.displayMode) {
return 'math+display:' + input;
} else {
return 'math:' + input;
}
},
},
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment