-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When bundling mathjax - you are warned that there is a circular dependency: ```shell code: CIRCULAR_DEPENDENCY, message: Circular dependency: node_modules/mathjax-full/js/input/tex/TexParser.js -> node_modules/mathjax-full/js/input/tex/ParseUtil.js -> node_modules/mathjax-full/js/input/tex/TexParser.js ``` This can lead to runtime errors as the bundler has to guess which module to define first. This commit removes this circular dependency. > Note: there are still other circular dependencies in place that should also be fixed: ```shell 1) components/loader.js > components/package.js 2) input/tex/mathtools/MathtoolsConfiguration.js > input/tex/mathtools/MathtoolsMappings.js > input/tex/mathtools/MathtoolsMethods.js > input/tex/mathtools/MathtoolsUtil.js 3) input/tex/mathtools/MathtoolsMethods.js > input/tex/mathtools/MathtoolsUtil.js 4) output/svg.js > output/svg/WrapperFactory.js > output/svg/Wrappers.js > output/svg/Wrapper.js ```
- Loading branch information
Showing
10 changed files
with
115 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ | |
* @author [email protected] (Volker Sorge) | ||
*/ | ||
|
||
import ParseUtil from './ParseUtil.js'; | ||
import {HandlerType} from './MapHandler.js'; | ||
import Stack from './Stack.js'; | ||
import StackItemFactory from './StackItemFactory.js'; | ||
|
@@ -35,6 +34,8 @@ import ParseOptions from './ParseOptions.js'; | |
import {StackItem, EnvList} from './StackItem.js'; | ||
import {Symbol} from './Symbol.js'; | ||
import {OptionList} from '../../util/Options.js'; | ||
import {matchDimen} from '../../util/lengths.js'; | ||
import {trimSpaces} from '../../util/string.js'; | ||
|
||
|
||
/** | ||
|
@@ -392,15 +393,15 @@ export default class TexParser { | |
public GetDimen(name: string): string { | ||
if (this.GetNext() === '{') { | ||
let dimen = this.GetArgument(name); | ||
let [value, unit] = ParseUtil.matchDimen(dimen); | ||
let [value, unit] = matchDimen(dimen); | ||
if (value) { | ||
// @test Raise In Line, Lower 2, (Raise|Lower) Negative | ||
return value + unit; | ||
} | ||
} else { | ||
// @test Above, Raise, Lower, Modulo, Above With Delims | ||
let dimen = this.string.slice(this.i); | ||
let [value, unit, length] = ParseUtil.matchDimen(dimen, true); | ||
let [value, unit, length] = matchDimen(dimen, true); | ||
if (value) { | ||
this.i += length; | ||
return value + unit; | ||
|
@@ -475,7 +476,7 @@ export default class TexParser { | |
* @return {string} The delimiter. | ||
*/ | ||
public GetDelimiterArg(name: string): string { | ||
let c = ParseUtil.trimSpaces(this.GetArgument(name)); | ||
let c = trimSpaces(this.GetArgument(name)); | ||
if (c === '') { | ||
return null; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters