mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
This reverts commit d93a958379
.
This commit is contained in:
16
katex.js
16
katex.js
@@ -18,7 +18,7 @@ import utils from "./src/utils";
|
||||
* Parse and build an expression, and place that expression in the DOM node
|
||||
* given.
|
||||
*/
|
||||
const render = function(expression, baseNode, options) {
|
||||
let render = function(expression, baseNode, options) {
|
||||
utils.clearNode(baseNode);
|
||||
|
||||
const settings = new Settings(options);
|
||||
@@ -29,6 +29,20 @@ const render = function(expression, baseNode, options) {
|
||||
baseNode.appendChild(node);
|
||||
};
|
||||
|
||||
// KaTeX's styles don't work properly in quirks mode. Print out an error, and
|
||||
// disable rendering.
|
||||
if (typeof document !== "undefined") {
|
||||
if (document.compatMode !== "CSS1Compat") {
|
||||
typeof console !== "undefined" && console.warn(
|
||||
"Warning: KaTeX doesn't work in quirks mode. Make sure your " +
|
||||
"website has a suitable doctype.");
|
||||
|
||||
render = function() {
|
||||
throw new ParseError("KaTeX doesn't work in quirks mode.");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and build an expression, and return the markup for that.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user