-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make path resolving more flexible, and don't fail when loading entity files. (mathjax/MathJax#2650) #644
Conversation
…ilter for entities to load the full entity component when MathML input is used. (mathjax/MathJax#2650)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to experiment with this first. But I have enough of code reviewing for now...
No problem. Thanks for all the reviews. You have done yeoman work today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question and a couple of typos.
ts/components/loader.ts
Outdated
}; | ||
startup?: any; | ||
} | ||
|
||
/** | ||
* Functions to used to filter the path to a package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo.
ts/components/loader.ts
Outdated
}, | ||
|
||
/** | ||
* Revursively replace path prefixes (e.g., [mathjax], [tex], etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
This PR adds a function list to use for resolving the path to a component file (i.e., package), and populates it with several default filters (the ones that were in the original
resolvePath()
method). This allows extensions to add or remove the filters as needed, and is used by the MathML input component to handle loading entity files when needed.In the past, the Entities object would try to load entity definitions when an entity wasn't found in its default table. That works for node applications, but for in-browser use, which requires components, not just files, that caused MathJax to fail. (Fortunately, the browser usually handles the entities, but it could cause problems with entities not known in the browser, and in some other edge cases).
This PR resolves that problem by adding a filter to remap attempts to load an entity file to instead load the "all entities" component.
Resolves issue mathjax/MathJax#2650.