@@ -35,7 +35,7 @@ import {OutputJax} from '../core/OutputJax.js';
3535import { CommonOutputJax } from '../output/common/OutputJax.js' ;
3636import { DOMAdaptor } from '../core/DOMAdaptor.js' ;
3737import { PrioritizedList } from '../util/PrioritizedList.js' ;
38- import { OptionList } from '../util/Options.js' ;
38+ import { OptionList , OPTIONS } from '../util/Options.js' ;
3939
4040import { TeX } from '../input/tex.js' ;
4141
@@ -54,6 +54,8 @@ export interface MathJaxConfig extends MJConfig {
5454 typeset ?: boolean ; // Perform initial typeset?
5555 ready ?: ( ) => void ; // Function to perform when components are ready
5656 pageReady ?: ( ) => void ; // Function to perform when page is ready
57+ invalidOption ?: 'fatal' | 'warn' ; // Do invalid options produce a warning, or throw an error?
58+ optionError ?: ( message : string , key : string ) => void , // Function to report invalid options
5759 [ name : string ] : any ; // Other configuration blocks
5860 } ;
5961}
@@ -534,8 +536,8 @@ export const MathJax = MJGlobal as MathJaxObject;
534536
535537/*
536538 * If the startup module hasn't been added to the MathJax variable,
537- * Add the startup configuration and data objects, and create
538- * the initial typeset and conversion calls .
539+ * Add the startup configuration and data objects, and
540+ * set the method for handling invalid options, if provided .
539541 */
540542if ( typeof MathJax . _ . startup === 'undefined' ) {
541543
@@ -555,6 +557,13 @@ if (typeof MathJax._.startup === 'undefined') {
555557 options : { }
556558 } ) ;
557559
560+ if ( MathJax . config . startup . invalidOption ) {
561+ OPTIONS . invalidOption = MathJax . config . startup . invalidOption ;
562+ }
563+ if ( MathJax . config . startup . optionError ) {
564+ OPTIONS . optionError = MathJax . config . startup . optionError ;
565+ }
566+
558567}
559568
560569/**
0 commit comments