Skip to content
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

Merged
merged 2 commits into from
Apr 8, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Mar 19, 2021

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.

…ilter for entities to load the full entity component when MathML input is used. (mathjax/MathJax#2650)
@dpvc dpvc requested a review from zorkow March 19, 2021 13:37
@dpvc dpvc added this to the 3.1.3 milestone Mar 19, 2021
Copy link
Member

@zorkow zorkow left a 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...

@dpvc
Copy link
Member Author

dpvc commented Mar 19, 2021

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!

Copy link
Member

@zorkow zorkow left a 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.

};
startup?: any;
}

/**
* Functions to used to filter the path to a package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo.

},

/**
* Revursively replace path prefixes (e.g., [mathjax], [tex], etc.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@dpvc dpvc merged commit 3f53ede into develop Apr 8, 2021
@dpvc dpvc deleted the issue2650 branch April 8, 2021 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants