mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-08 20:48:41 +00:00
\newcommand, \renewcommand, \providecommand (#1382)
* \newcommand, \renewcommand, \providecommand * Tests * Add comment * Add symbols to the set of already defined things * Add implicitCommands, catch \hline outside array * Add \relax * Move isDefined to be a method of MacroExpander * Namespace.has * Reword error messages * Add \hdashline given #1407
This commit is contained in:
@@ -8,13 +8,9 @@ import Options from "../src/Options";
|
||||
import Settings from "../src/Settings";
|
||||
import Style from "../src/Style";
|
||||
|
||||
const defaultSettings = new Settings({});
|
||||
|
||||
const getMathML = function(expr, settings) {
|
||||
const usedSettings = settings ? settings : defaultSettings;
|
||||
|
||||
const getMathML = function(expr, settings = new Settings()) {
|
||||
let startStyle = Style.TEXT;
|
||||
if (usedSettings.displayMode) {
|
||||
if (settings.displayMode) {
|
||||
startStyle = Style.DISPLAY;
|
||||
}
|
||||
|
||||
@@ -24,7 +20,7 @@ const getMathML = function(expr, settings) {
|
||||
maxSize: Infinity,
|
||||
});
|
||||
|
||||
const built = buildMathML(parseTree(expr, usedSettings), expr, options);
|
||||
const built = buildMathML(parseTree(expr, settings), expr, options);
|
||||
|
||||
// Strip off the surrounding <span>
|
||||
return built.children[0].toMarkup();
|
||||
|
Reference in New Issue
Block a user