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

Fix problem with \rightarrow being converted to \vec in some cases. (mathjax/MathJax#2380) #468

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Apr 3, 2020

Fix MmlMo.coreParent() to produce the documented element, and fix accent mapping to only remap when the (possibly embellished) mo is the only element in the accent position.

Resolves issue mathjax/MathJax#2380.

…pping to only remap when the (possibly embellished) mo is the only element in the accent position
@dpvc dpvc changed the title Fix problem with Fix problem with \rightarrow being converted to \vec in some cases. (mathjax/MathJax#2380) Apr 3, 2020
@dpvc dpvc added this to the 3.0.2 milestone Apr 3, 2020
@dpvc dpvc requested a review from zorkow April 3, 2020 20:31
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 can confirm that it works.

@@ -170,7 +172,7 @@ export class MmlMo extends AbstractMmlTokenNode {
*/
get isAccent() {
let accent = false;
const node = this.coreParent();
const node = this.coreParent().parent;
Copy link
Member

Choose a reason for hiding this comment

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

Are we sure this always exists?

Copy link
Member Author

Choose a reason for hiding this comment

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

The coreParent() call always returns an element (in the code for coreParent() just above this, the embellished operator starts as this, which is non-null, and only gets updated within the loop, where it is set to parent, which is known to be non-null by the condition of the while loop).

While its parent attribute may be null, the next line (just below these comments) checks for that.

@dpvc dpvc merged commit 15b98a4 into develop Apr 6, 2020
@dpvc dpvc deleted the issue2380 branch April 6, 2020 20:53
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